//
//  DriverAuthVC.m
//  阿帕
//
//  Created by mac on 2020/9/10.
//  Copyright © 2020 GCY. All rights reserved.
//

#import "DriverAuthVC.h"
#import "ImageUploadViewController.h"
#import "STPickerView.h"
#import "STPickerSingle.h"
#import "CYCityChooseView.h"
#import "TZImagePickerController.h"
#import "CYWebViewViewController.h"
#import "GeneralPopUp.h"

//人脸识别
#ifdef isOpenBaiDuFaceSDK
#import "BDFaceLivenessViewController.h"
#import "BDFaceDetectionViewController.h"
#import "BDFaceLivingConfigModel.h"
#import "IDLFaceSDK/IDLFaceSDK.h"
#import "FaceParameterConfig.h"
#endif

@interface DriverAuthVC ()<TZImagePickerControllerDelegate, DeliveredImageUrlDelegate, CYChooseRegionDelegate, STPickerSingleDelegate, UITextFieldDelegate>
{
    BOOL _axlenumHiddenFlag;
    BOOL _sexHiddenFlag;
    NSString *_sex;//性别
    NSString *_vehicleLicenseImg;
    NSString *_vehicleLicenseDeputyPageImg;
    NSString *_driverLicenseImg;
    NSString *_identificationImg;
    NSString *_identificationBackImg;
    NSString *_roadTransportCertificateImg;
    NSString *_workLicenseImg;
    NSString *_roadPerExpiryDateImg;
    NSString *_driverImg;
    NSString *_roadPermitNumberImg;
    NSString *_vehicleImg;
    NSString *_safeDutyInsureImg;
    NSString *_depenDealImg;
    NSString *_stateImg;
    NSString *_trailerVehicleLicenseImg;
    NSString *_trailerVehicleImg;
    NSString *_trailerRoadTransportCertificateImg;
    NSString *_trailerVehicleLicenseDeputyPageImg;
    NSString *_trailerLicenseColor;
    NSString *_trailerClassificationCode;
    
    NSString *_provinceCode;
    NSString *_cityCode;
    NSString *_countyCode;
    
    NSString *_vehicleClass;
    NSString *_loadWeight;
    NSString *_totalWeight;
    NSString *_vehicleLicenseColor;
    NSString *_vehicleEnergyType;
    NSString *_selfRespect;
    NSString *_vehicleLength;
    NSString *_vehicleWidth;
    NSString *_vehicleHeight;
    CGFloat _totalWeightNum;
    
    NSString *_classificationCode;
    NSString *_lastIdardDueDate;//记录上一次选择身份证到期的日期
    NSString *_lastDriverLicenseDueDate;//记录上一次选择驾驶证到期的日期
    
    BOOL _idCardIsLongtime;//身份证是否是长期
    BOOL _licenseIsLongtime;//驾驶证是否是长期
    
    NSInteger _isTax;///天津税务开关
    NSInteger _reportPlatform;//性别、车轴开关
}
@property (strong , nonatomic)ImageUploadViewController *uploadImgVC;
@property (strong , nonatomic)NSDictionary *dynamicFieldDic;

@property (strong , nonatomic)UIView *viewAdress;
@property (strong , nonatomic)UIButton *vehicleLicenseBtn;
@property (strong , nonatomic)UIButton *vehicleLicenseDeputyPageBtn;
@property (strong , nonatomic)UIButton *driverLicenseBtn;
@property (strong , nonatomic)UIButton *identificationBtn;
@property (strong , nonatomic)UIButton *identificationBackBtn;
@property (strong , nonatomic)UIButton *roadTransportCertificateBtn;
@property (strong , nonatomic)UIButton *workLicenseBtn;
@property (strong , nonatomic)UIButton *driverImgBtn;
@property (strong , nonatomic)UIButton *roadPermitBtn;
@property (strong , nonatomic)UIButton *vehicleImgBtn;
@property (strong , nonatomic)UIButton *safeDutyInsureImgBtn;
@property (strong , nonatomic)UIButton *depenDealImgBtn;
@property (strong , nonatomic)UIButton *stateImgBtn;
@property (strong , nonatomic)UIButton *saveBtn;
@property (strong , nonatomic)UIButton *editBtn;
@property (strong , nonatomic)UIButton *backBtn;

@property (strong , nonatomic)UIView *requiredBgView;
@property (strong , nonatomic)UIImageView *affiliatedImageView;
@property (strong , nonatomic)UIImageView *manImageView;
@property (strong , nonatomic)UIImageView *womenImageView;
@property (strong , nonatomic)UIImageView *powerAttorneyAgreeImageView;
@property (strong , nonatomic)UIImageView *powerAttorneyRefusedImageView;
@property (strong , nonatomic)UIImageView *trailerImageView;
@property (strong , nonatomic)UIImageView *totalArrowImageView;
@property (strong , nonatomic)UIImageView *noRequiredArrowImageView;
@property (strong , nonatomic)UIImageView *authTopImageView;
@property (strong , nonatomic)UIImageView *idCardDateIsLongtimeImageView;
@property (strong , nonatomic)UIImageView *driverLicenseDueDateIsLongtimeImageView;

@property (assign , nonatomic)BOOL isLinked;
@property (assign , nonatomic)BOOL isTrailer;
@property (assign , nonatomic)BOOL isOpenTotalWeight;
@property (assign , nonatomic)BOOL isOpenNoRequired;
@property (assign , nonatomic)BOOL isArgee;

@property (strong , nonatomic)UITextField *nameTF;
@property (strong , nonatomic)UITextField *phoneTF;
@property (strong , nonatomic)UITextField *idCardTF;
@property (strong , nonatomic)UITextField *chePaiNumTF;
@property (strong , nonatomic)UITextField *cheLiangDaoLuYunShuNumTF;
@property (strong , nonatomic)UITextField *daoLuYunShuJingYingNumTF;
@property (strong , nonatomic)UITextField *daoLuYunShuCongYeNumTF;
@property (strong , nonatomic)UITextField *detailAddressTF;
@property (strong , nonatomic)UITextField *workUnitTF;
@property (strong , nonatomic)UITextField *axlenumTF;
@property (strong , nonatomic)UITextField *vehicleOwnerTF;
@property (strong , nonatomic)UITextField *vehicleJiaShiZhengTF;
@property (strong , nonatomic)UITextField *vehicleXingShiZhengTF;
@property (strong , nonatomic)UITextField *vehicleActualOwnerTF;
@property (strong , nonatomic)UITextField *vehicleActualOwnerPhoneTF;
@property (strong , nonatomic)UITextField *tongXunDiZhiTF;
@property (strong , nonatomic)UITextField *vehicleTypeTF;
@property (strong , nonatomic)UITextField *vehicleLoadWeightTF;
@property (strong , nonatomic)UITextField *vehicleTotaleightTF;
@property (strong , nonatomic)UITextField *licensePlateColorTF;
@property (strong , nonatomic)UITextField *vehicleEnergyTypesTF;
@property (strong , nonatomic)UITextField *xingShiZhengEndDateTF;
@property (strong , nonatomic)UITextField *vehicleBrandTF;

@property (strong , nonatomic)UITextField *trailerNumTF;
@property (strong , nonatomic)UITextField *trailerLicenseColorTF;
@property (strong , nonatomic)UITextField *trailerTypeTF;
@property (strong , nonatomic)UITextField *trailerDaoLuYunShuZhengTF;
@property (strong , nonatomic)UITextField *trailerTotalWeightTF;
@property (strong , nonatomic)UITextField *trailerLoadWeightTF;
@property (strong , nonatomic)UIButton *trailerXingShiZhengBtn;
@property (strong , nonatomic)UIButton *trailerZhaoBtn;
@property (strong , nonatomic)UIButton *trailerDaoLuYunShuZhengBtn;
@property (strong , nonatomic)UIButton *trailerVehicleLicenseDeputyPageImgBtn;

@property (strong , nonatomic)UIButton    *totalWeightBgView;
@property (strong , nonatomic)UITextField *jiaShiZhengFaZhengJiGuanTF;
@property (strong , nonatomic)UITextField *xingShiZhengFaZhengJiGuanTF;
@property (strong , nonatomic)UITextField *cheLiangShiBieVINTF;
@property (strong , nonatomic)UITextField *shiYongXingZhiTF;
@property (strong , nonatomic)UITextField *zhunJiavehicleTypeTF;
@property (strong , nonatomic)UITextField *driverLicenseFromDateTF;
@property (strong , nonatomic)UITextField *driverLicenseDueDateTF;
@property (strong , nonatomic)UITextField *registerDateTF;
@property (strong , nonatomic)UITextField *issueDateTF;
@property (strong , nonatomic)UITextField *idCardDueDateTF;

@property (strong , nonatomic)UIView *noRequiredBgView;
@property (strong , nonatomic)UITextField *roadTransportCertificateDateTF;
@property (strong , nonatomic)UITextField *workLicenseDueDateTF;
@property (strong , nonatomic)UITextField *selfRespectTF;
@property (strong , nonatomic)UITextField *carLengthLabel;
@property (strong , nonatomic)UITextField *carWidthLabel;
@property (strong , nonatomic)UITextField *carHeightLabel;
@property (strong , nonatomic)UILabel *authStateLabel;
@property (strong , nonatomic)UILabel *authStateDetailLabel;
@property (strong , nonatomic)UILabel *powerAattorneyLabel;
@property (strong , nonatomic)UILabel *idCardDueDateRemindLabel;///身份证到期提醒文字
@property (strong , nonatomic)UILabel *vehicleTotalLessSiDianWuTextLab;///身份证到期提醒文字

@property (nonatomic,strong) STPickerSingle *vehicleTypePickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleZaiZhongPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleZiZhongPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleZongZhongPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleLicenseColorPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleEnergyTypePickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleClassPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleLengthPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleWidthPickerSingle;
@property (nonatomic,strong) STPickerSingle *vehicleHeightPickerSingle;
@property (nonatomic,strong) STPickerSingle *trailerLicenseColorPickerSingle;
@property (nonatomic,strong) STPickerSingle *trailerTypePickerSingle;
@property (strong , nonatomic)NSMutableArray *vechicleTypeArray;
@property (strong , nonatomic)NSMutableArray *vechicleTonnageArray;
@property (strong , nonatomic)NSMutableArray *vechicleEnergyTypeArray;
@property (strong , nonatomic)NSMutableArray *vehicleClassArray;
@property (strong , nonatomic)NSMutableArray *vechicleTypeModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleTonnageModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleEnergyModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleLicenseColorTitleArray;
@property (strong , nonatomic)NSMutableArray *vechicleLicenseColorModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleClassModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleLengthArray;
@property (strong , nonatomic)NSMutableArray *vechicleLengthModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleWidthArray;
@property (strong , nonatomic)NSMutableArray *vechicleWidthModelArray;
@property (strong , nonatomic)NSMutableArray *vechicleHeightArray;
@property (strong , nonatomic)NSMutableArray *vechicleHeightModelArray;

@property (strong , nonatomic)UIView *wtsqsBgView;
@property (strong , nonatomic)UIView *viewSave;
@property (strong , nonatomic)UIView *editView;
@property (strong , nonatomic)UIView *roadPermitImgBgView;
@property (strong , nonatomic)UIView *roadPermitNumBgView;

@property (strong , nonatomic)UILabel *vehicleLicenseImgView;
@property (strong , nonatomic)UILabel *driverLicenseImgView;
@property (strong , nonatomic)UILabel *identificationImgView;
@property (strong , nonatomic)UILabel *identificationBackImgView;
@property (strong , nonatomic)UILabel *roadTransportCertificateImgView;
@property (strong , nonatomic)UILabel *workLicenseImgView;
@property (strong , nonatomic)UILabel *driverImgView;
@property (strong , nonatomic)UILabel *roadPermitImgView;
@property (strong , nonatomic)UILabel *vehicleImgView;
@property (strong , nonatomic)UILabel *depenDealImgAsterisk;///挂靠协议星号
@property (strong , nonatomic)UILabel *safeDutyInsureImgView;
@property (strong , nonatomic)UILabel *nameTFView;
@property (strong , nonatomic)UILabel *idCardTFView;
@property (strong , nonatomic)UILabel *chePaiNumTFView;
@property (strong , nonatomic)UILabel *cheLiangDaoLuYunShuNumTFView;
@property (strong , nonatomic)UILabel *daoLuYunShuCongYeNumTFView;
@property (strong , nonatomic)UILabel *detailAddressTFView;
@property (strong , nonatomic)UILabel *workUnitTFView;
@property (strong , nonatomic)UILabel *vehicleOwnerTFView;
@property (strong , nonatomic)UILabel *vehicleJiaShiZhengTFView;
@property (strong , nonatomic)UILabel *vehicleXingShiZhengTFView;
@property (strong , nonatomic)UILabel *axlenumTFView;
@property (strong , nonatomic)UILabel *tongXunDiZhiTFView;
@property (strong , nonatomic)UILabel *vehicleTypeTFView;
@property (strong , nonatomic)UILabel *vehicleLoadWeightTFView;
@property (strong , nonatomic)UILabel *vehicleTotaleightTFView;
@property (strong , nonatomic)UILabel *licensePlateColorTFView;
@property (strong , nonatomic)UILabel *vehicleEnergyTypesTFView;
@property (strong , nonatomic)UILabel *xingShiZhengEndDateTFView;
@property (strong , nonatomic)UILabel *sexView;
@property (strong , nonatomic)UILabel *trailerNumTFView;
@property (strong , nonatomic)UILabel *trailerLicenseColorTFView;
@property (strong , nonatomic)UILabel *trailerTypeTFView;
@property (strong , nonatomic)UILabel *trailerDaoLuYunShuZhengTFView;
@property (strong , nonatomic)UILabel *trailerXingShiZhengBtnView;
@property (strong , nonatomic)UILabel *trailerZhaoBtnView;
@property (strong , nonatomic)UILabel *trailerDaoLuYunShuZhengBtnView;
@property (strong , nonatomic)UILabel *vehicleActualOwnerPhoneAsterisk;
@property (strong , nonatomic)UILabel *stateImgAsterisk;
@property (strong , nonatomic)UILabel *affiliatAsterisk;
@property (strong , nonatomic)UILabel *vehicleActualOwnerAsterisk;
@property (strong , nonatomic)UILabel *vehicleLicenseDeputyPageImgView;///车辆行驶证副页必填星号
@property (strong , nonatomic)UILabel *trailerVehicleLicenseDeputyPageImgBtnView;
@property (strong , nonatomic)UILabel *idCardDueDateView;///身份证有效期必填星号
@property (strong , nonatomic)UILabel *trailerTotalWeightView;
@property (strong , nonatomic)UILabel *trailerLoadWeightView;
@property (strong , nonatomic)UILabel *vehicleBrandAsterisk; ///车辆品牌必填星号
@property (strong , nonatomic)UILabel *phoneAsterisk;

@property (strong , nonatomic)UILabel *roadTransportCertificateDateTFView;
@property (strong , nonatomic)UILabel *workLicenseDueDateTFView;
@property (strong , nonatomic)UILabel *selfRespectTFView;
@property (strong , nonatomic)UILabel *carSizeView;

@property (strong , nonatomic)UILabel *jiaShiZhengFaZhengJiGuanTFView;
@property (strong , nonatomic)UILabel *cheLiangShiBieVINTFView;
@property (strong , nonatomic)UILabel *xingShiZhengFaZhengJiGuanTFView;
@property (strong , nonatomic)UILabel *shiYongXingZhiTFView;
@property (strong , nonatomic)UILabel *zhunJiavehicleTypeTFView;
@property (strong , nonatomic)UILabel *driverLicenseFromDateTFView;
@property (strong , nonatomic)UILabel *driverLicenseDueDateTFView;
@property (strong , nonatomic)UILabel *registerDateTFView;
@property (strong , nonatomic)UILabel *issueDateTFView;

@property (strong , nonatomic)UILabel *vehicleTotalWeightTextLab;
@property (strong , nonatomic)UILabel *vehicleLoadWeightTextLab;

@property (strong , nonatomic)UITextField *roadPermitNameTF;
@property (strong , nonatomic)UIView *roadPermitNameBgView;

/** 照片容器View */
@property (strong , nonatomic)UIView *photoBgView;

/// 车辆行驶证正页照
@property (strong , nonatomic)UIView *vehicleLicenseImgContainerView;
/// 车辆行驶证背面照
@property (strong , nonatomic)UIView *vehicleLicenseDeputyPageImgContainerView;
/// 身份证正面照
@property (strong , nonatomic)UIView *identificationImgContainerView;
/// 身份证背面照
@property (strong , nonatomic)UIView *identificationBackImgContainerView;
/// 司机照
@property (strong , nonatomic)UIView *driverImgContainerView;
/// 驾驶证照片
@property (strong , nonatomic)UIView *driverLicenseImgContainerView;
/// 道路运输从业资格证
@property (strong , nonatomic)UIView *workLicenseImgContainerView;

/// 道路运输经营许可证照
@property (strong , nonatomic)UIView *roadPermitImgContainerView;
/// 车辆照
@property (strong , nonatomic)UIView *vehicleImgContainerView;
/// 车辆道路运输证照
@property (strong , nonatomic)UIView *roadTransportCertificateImgContainerView;
/// 安全责任险照
@property (strong , nonatomic)UIView *safeDutyInsureImgContainerView;
/// 车主声明照
@property (strong , nonatomic)UIView *stateImgBgView;
/// 挂靠协议照
@property (strong , nonatomic)UIView *depenDealImgView;
/// 挂车行驶证正页照
@property (strong , nonatomic)UIView *trailerVehicleLicenseImgContainerView;
/// 挂车行驶证副页照
@property (strong , nonatomic)UIView *trailerVehicleLicenseDeputyPageImgContainerView;
/// 挂车照片未上传
@property (strong , nonatomic)UIView *trailerVehicleImgContainerView;
/// 挂车道路运输证照
@property (strong , nonatomic)UIView *trailerRoadTransportCertificateImgContainerView;

/** 输入容器View */

/// 是否挂靠
@property (strong , nonatomic)UIView *affiliatedBgView;
/// 姓名
@property (strong , nonatomic)UIView *nameContainerView;
/// 联系方式
@property (strong , nonatomic)UIView *phoneContainerView;
/// 身份证
@property (strong , nonatomic)UIView *idCardContainerView;
/// 车牌号
@property (strong , nonatomic)UIView *licenseNumberContainerView;
/// 车辆道路运输证号
@property (strong , nonatomic)UIView *roadTransportCertificateNumberContainerView;
/// 道路运输经营许可证号
@property (strong , nonatomic)UIView *roadPermitNumberContainerView;
/// 道路运输从业资格证号
@property (strong , nonatomic)UIView *workLicenseContainerView;
/// 详细地址
@property (strong , nonatomic)UIView *homeAddressContainerView;
/// 工作单位
@property (strong , nonatomic)UIView *workCompanyContainerView;
/// 车辆所有人
@property (strong , nonatomic)UIView *ownerContainerView;
/// 机动车驾驶证号
@property (strong , nonatomic)UIView *driverLicenseContainerView;
/// 车辆行驶证档案编号
@property (strong , nonatomic)UIView *vehicleLicenseContainerView;
/// 通讯地址
@property (strong , nonatomic)UIView *areaListContainerView;
/// 车辆实际所有人
@property (strong , nonatomic)UIView *vehicleActualOwnerView;
/// 车辆实际所有人联系方式
@property (strong , nonatomic)UIView *vehicleActualOwnerPhoneView;
/// 车辆类型
@property (strong , nonatomic)UIView *classificationCodeContainerView;
/// 核定载质量
@property (strong , nonatomic)UIView *loadWeightContainerView;
/// 车辆总质量
@property (strong , nonatomic)UIView *totalWeightContainerView;
/// 车牌颜色
@property (strong , nonatomic)UIView *vehicleLicenseColorContainerView;
/// 车辆能源类型
@property (strong , nonatomic)UIView *vehicleEnergyTypeContainerView;
/// 车辆行驶证到期日期
@property (strong , nonatomic)UIView *vehicleLicenseDueDateContainerView;
/// 身份证有效期
@property (strong , nonatomic)UIView *idCardDueDateContainerView;
/// 车辆品牌背景
@property (strong , nonatomic)UIView *vehicleBrandBgView;
/// 车轴数
@property (strong , nonatomic)UIView *axlenumBgView;
/// 性别
@property (strong , nonatomic)UIView *sexBgView;
/// 是否挂车
@property (strong , nonatomic)UIView *isHasTrailerContainerView;
/// 挂车区域
@property (strong , nonatomic)UIView *trailerBgView;
/// 挂车车牌
@property (strong , nonatomic)UIView *trailerNumContainerView;
/// 挂车车牌颜色
@property (strong , nonatomic)UIView *trailerLicenseColorContainerView;
/// 挂车车辆类型
@property (strong , nonatomic)UIView *trailerClassificationCodeContainerView;
/// 挂车道路运输证
@property (strong , nonatomic)UIView *trailerRoadTransportContainerView;
/// 挂车核定载质量
@property (strong , nonatomic)UIView *trailerTotalWeightContainerView;
/// 挂车核定载质量
@property (strong , nonatomic)UIView *trailerLoadWeightContainerView;
/// 道路运输证到期日期
@property (strong , nonatomic)UIView *roadTransportCertificateDateContainerView;
/// 道路运输从业资格证到期日期
@property (strong , nonatomic)UIView *workLicenseDueDateContainerView;
/// 车身自重
@property (strong , nonatomic)UIView *selfRespectContainerView;
/// 外廓尺寸
@property (strong , nonatomic)UIView *dimensionContainerView;
/// 驾驶证发证机关
@property (strong , nonatomic)UIView *driverIssuingOrganizationsContainerView;
/// 行驶证发证机关
@property (strong , nonatomic)UIView *vehicleIssuingOrganizationsContainerView;
/// VIN
@property (strong , nonatomic)UIView *vinContainerView;
/// 使用性质
@property (strong , nonatomic)UIView *useCharacterContainerView;
/// 准驾车型
@property (strong , nonatomic)UIView *vehicleClassContainerView;
/// 驾驶证有效期开始
@property (strong , nonatomic)UIView *driverLicenseFromDateContainerView;
/// 驾驶证到期日期
@property (strong , nonatomic)UIView *driverLicenseDueDateContainerView;
/// 驾驶证注册日期
@property (strong , nonatomic)UIView *registerDateContainerView;
/// 行驶证发证日期
@property (strong , nonatomic)UIView *issueDateContainerView;

/// 车辆总质量<=4.5吨必填项
@property (strong , nonatomic)UIView *p45ContainerView;
/// 其他
@property (strong , nonatomic)UIView *otherContainerView;

@end

@implementation DriverAuthVC

- (void)dealloc {
    [KNotificationCenter removeObserver:self name:@"faceIdentifySuccess" object:nil];
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    [KNotificationCenter addObserver:self selector:@selector(faceIdentifyCompleted:) name:@"faceIdentifySuccess" object:nil];
    
    self.navigationItem.title = @"司机认证信息";
    
    [self baseSetup];
    
    [self formValidationSetup];
    
    if (_isNotEdit) {
        [self notEditSetUp];
    } else {
        [self notEditSetUp];
        _viewSave.hidden = YES;
        _editView.hidden = NO;
        [self vechicleTypeListRequest];//车辆类型
        [self vechicleEnergyTypeListRequest];//车辆能源类型
        [self vehicleClassListRequest];//准驾车型
        
        //        [self vechicleTonnageListRequest];//车辆吨位请求
        
        //        [self vehicleLengthWidthHeightListRequest];
        
        [self vehicleLicenseColorListRequest]; // 车牌颜色
    }
    
    [self getAuthDetailInfoRequest];
    
    [self fieldCalibrationRequest];
    
    // 联系方式不允许直接修改
    _phoneTF.enabled = NO;
    _idCardTF.enabled = NO;
    _nameTF.enabled = NO;
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
}

- (void)baseSetup {
    
    _axlenumHiddenFlag = NO;
    _sexHiddenFlag = NO;
    
    _sex = @"";
    _isArgee = YES;
    _classificationCode = @"";
    _selfRespect = @"";
    _loadWeight = @"";
    _totalWeight = @"";
    _vehicleLicenseColor = @"";
    _vehicleEnergyType = @"";
    _trailerVehicleImg = @"";
    _trailerRoadTransportCertificateImg = @"";
    _trailerVehicleLicenseDeputyPageImg = @"";
    _trailerVehicleLicenseImg = @"";
    _trailerLicenseColor = @"";
    _trailerClassificationCode = @"";
    _vehicleLicenseImg = @"";
    _driverLicenseImg = @"";
    _identificationImg = @"";
    _identificationBackImg = @"";
    _roadTransportCertificateImg = @"";
    _workLicenseImg = @"";
    _roadPerExpiryDateImg = @"";
    _driverImg = @"";
    _roadPermitNumberImg = @"";
    _vehicleImg = @"";
    _safeDutyInsureImg = @"";
    _depenDealImg = @"";
    _vehicleClass = @"";///准驾车型
    _vehicleLength = @"";
    _vehicleWidth = @"";
    _vehicleHeight = @"";
    _provinceCode = @"";
    _cityCode = @"";
    _countyCode = @"";
    _stateImg = @"";//车主声明图片
    _vehicleLicenseDeputyPageImg = @"";
    _lastIdardDueDate = @"";
    _lastDriverLicenseDueDate = @"";

    _powerAttorneyAgreeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
    _powerAattorneyLabel.textColor = Theme_ColorValue;
    
    _vehicleLicenseBtn.titleLabel.font = font(13);
    _vehicleLicenseDeputyPageBtn.titleLabel.font = font(13);
    _driverLicenseBtn.titleLabel.font = font(13);
    _identificationBtn.titleLabel.font = font(13);
    _identificationBackBtn.titleLabel.font = font(13);
    _roadTransportCertificateBtn.titleLabel.font = font(13);
    _workLicenseBtn.titleLabel.font = font(13);
    _driverImgBtn.titleLabel.font = font(13);
    _roadPermitBtn.titleLabel.font = font(13);
    _vehicleImgBtn.titleLabel.font = font(13);
    _safeDutyInsureImgBtn.titleLabel.font = font(13);
    _depenDealImgBtn.titleLabel.font = font(13);
    _stateImgBtn.titleLabel.font = font(13);
    _trailerXingShiZhengBtn.titleLabel.font = font(13);
    _trailerZhaoBtn.titleLabel.font = font(13);
    _trailerDaoLuYunShuZhengBtn.titleLabel.font = font(13);
    _trailerVehicleLicenseDeputyPageImgBtn.titleLabel.font = font(13);
    [_saveBtn setBackgroundColor:Theme_ColorValue];
    [_editBtn setBackgroundColor:Theme_ColorValue];
    [_backBtn setBackgroundColor:Theme_ColorValue];
    
    _authStateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 130, ScreenW, 30)];
    _authStateLabel.textAlignment = NSTextAlignmentCenter;
    _authStateLabel.text = @"未审核";
    _authStateLabel.textColor = [UIColor whiteColor];
    _authStateLabel.font = font(17);
    [_authTopImageView addSubview:_authStateLabel];
    
    _authStateDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 150, ScreenW, 30)];
    _authStateDetailLabel.textAlignment = NSTextAlignmentCenter;
    _authStateDetailLabel.textColor = [UIColor redColor];
    _authStateDetailLabel.font = font(12);
    [_authTopImageView addSubview:_authStateDetailLabel];
    
    _vehicleTotaleightTF.delegate = self;
    
    _isTax = [[UserDefaultUtil valueForKey:Login_Branch][@"isTax"] integerValue];///天津税务开关
    if (_isTax == 1) {
        _stateImgBgView.hidden = NO;//车主声明照
//        _affiliatedBgView.hidden = NO;//是否挂靠车辆
        _vehicleActualOwnerView.hidden = NO;//车辆实际所有人
        _vehicleActualOwnerPhoneView.hidden = NO;//车辆实际所有人联系方式
        _vehicleBrandBgView.hidden = NO;//车辆品牌
    }
    _affiliatedBgView.hidden = NO;//是否挂靠车辆
    
    if ([[UserDefaultUtil valueForKey:isOpenJCSaasModule] integerValue] == 1) {
        _wtsqsBgView.hidden = NO;//委托授权书
    }
    
    _reportPlatform = [[UserDefaultUtil valueForKey:Login_Branch][@"reportPlatform"] integerValue];
    if (_reportPlatform == 3) {
        //江苏省显示车轴、性别
        if (!_axlenumHiddenFlag) {
            _axlenumBgView.hidden = NO;
        }
        if (!_sexHiddenFlag) {
            _sexBgView.hidden = NO;
        }
    }
}

#pragma mark - 动态字段配置请求
- (void)fieldCalibrationRequest {
    
    NSDictionary *parmas = @{@"fieldFrom": @"driver", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], UPDATEFIELDREQUIRED) withParameter:parmas withVC:self netName:@"字段是否必填" success:^(id response, NSString *msg) {
        
        if ([DCSpeedy isBlankDictionary:response] == NO) {
            _dynamicFieldDic = response;
        }
        
        //照片部分
        if ([response[@"vehicleLicenseImg"] integerValue] == 0 || response[@"vehicleLicenseImg"] == NULL) {
//            _vehicleLicenseImgView.hidden = YES;
            _vehicleLicenseImgContainerView.hidden = YES;
        }
        if ([response[@"vehicleLicenseDeputyPageImg"] integerValue] == 0 || response[@"vehicleLicenseDeputyPageImg"] == NULL) {
//            _vehicleLicenseDeputyPageImgView.hidden = YES;
            _vehicleLicenseDeputyPageImgContainerView.hidden = YES;
        }
        if ([response[@"driverLicenseImg"] integerValue] == 0 || response[@"driverLicenseImg"] == NULL) {
//            _driverLicenseImgView.hidden = YES;
            _driverLicenseImgContainerView.hidden = YES;
        }
        if ([response[@"identificationImg"] integerValue] == 0 || response[@"identificationImg"] == NULL) {
//            _identificationImgView.hidden = YES;
            _identificationImgContainerView.hidden = YES;
        }
        if ([response[@"identificationBackImg"] integerValue] == 0 || response[@"identificationBackImg"] == NULL) {
//            _identificationBackImgView.hidden = YES;
            _identificationBackImgContainerView.hidden = YES;
        }
        if ([response[@"roadTransportCertificateImg"] integerValue] == 0 || response[@"roadTransportCertificateImg"] == NULL) {
//            _roadTransportCertificateImgView.hidden = YES;
            _roadTransportCertificateImgContainerView.hidden = YES;
        }
        if ([response[@"workLicenseImg"] integerValue] == 0 || response[@"workLicenseImg"] == NULL) {
//            _workLicenseImgView.hidden = YES;
            _workLicenseImgContainerView.hidden = YES;
        }

        if ([response[@"driverImg"] integerValue] == 0 || response[@"driverImg"] == NULL) {
//            _driverImgView.hidden = YES;
            _driverImgContainerView.hidden = YES;
        }
        if ([response[@"roadPermitNumberImg"] integerValue] == 0 || response[@"roadPermitNumberImg"] == NULL) {
//            _roadPermitImgView.hidden = YES;
            _roadPermitImgContainerView.hidden = YES;
        }
        if ([response[@"vehicleImg"] integerValue] == 0 || response[@"vehicleImg"] == NULL) {
//            _vehicleImgView.hidden = YES;
            _vehicleImgContainerView.hidden = YES;
        }
        if ([response[@"safeDutyInsureImg"] integerValue] == 0 || response[@"safeDutyInsureImg"] == NULL) {
//            _safeDutyInsureImgView.hidden = YES;
            _safeDutyInsureImgContainerView.hidden = YES;
        }
        if ([response[@"depenDealImg"] integerValue] == 0 || response[@"depenDealImg"] == NULL || _isTax == 0) {
//            _depenDealImgAsterisk.hidden = YES;
            _depenDealImgView.hidden = YES;
        }
        if ([response[@"stateImg"] integerValue] == 0 || response[@"stateImg"] == NULL) {
//            _stateImgAsterisk.hidden = YES;
            _stateImgBgView.hidden = YES;
        }
        if ([response[@"isLinked"] integerValue] == 0 || response[@"isLinked"] == NULL) {
            _affiliatAsterisk.hidden = YES;
            
//            _affiliatedBgView.hidden = YES;
//            _depenDealImgView.hidden = YES;
//            _isLinked = NO;
        }
        if ([response[@"name"] integerValue] == 0 || response[@"name"] == NULL) {
//            _nameTFView.hidden = YES;
            _nameContainerView.hidden = YES;
        }
        if ([response[@"roadPermitName"] integerValue] == 0 || response[@"roadPermitName"] == NULL) {
            _roadPermitNameBgView.hidden = YES;
        }
        if ([response[@"phone"] integerValue] == 0 || response[@"phone"] == NULL) {
//            _phoneAsterisk.hidden = YES;
            _phoneContainerView.hidden = YES;
        }
        if ([response[@"identificationNumber"] integerValue] == 0 || response[@"identificationNumber"] == NULL) {
//            _idCardTFView.hidden = YES;
            _idCardContainerView.hidden = YES;
        }
        if ([response[@"licenseNumber"] integerValue] == 0 || response[@"licenseNumber"] == NULL) {
//            _chePaiNumTFView.hidden = YES;
            _licenseNumberContainerView.hidden = YES;
        }
        if ([response[@"roadTransportCertificateNumber"] integerValue] == 0 || response[@"roadTransportCertificateNumber"] == NULL) {
//            _cheLiangDaoLuYunShuNumTFView.hidden = YES;
            _roadTransportCertificateNumberContainerView.hidden = YES;
        }
        if ([response[@"roadPermitNumber"] integerValue] == 0 || response[@"roadPermitNumber"] == NULL) {
//            _roadPermitNumBgView.hidden = YES;
            _roadPermitNumberContainerView.hidden = YES;
        }
        if ([response[@"workLicense"] integerValue] == 0 || response[@"workLicense"] == NULL) {
//            _daoLuYunShuCongYeNumTFView.hidden = YES;
            _workLicenseContainerView.hidden = YES;
        }
        if ([response[@"homeAddress"] integerValue] == 0 || response[@"homeAddress"] == NULL) {
//            _detailAddressTFView.hidden = YES;
            _homeAddressContainerView.hidden = YES;
        }
        if ([response[@"workCompany"] integerValue] == 0 || response[@"workCompany"] == NULL) {
//            _workUnitTFView.hidden = YES;
            _workCompanyContainerView.hidden = YES;
        }
        if ([response[@"owner"] integerValue] == 0 || response[@"owner"] == NULL) {
//            _vehicleOwnerTFView.hidden = YES;
            _ownerContainerView.hidden = YES;
        }
        if ([response[@"driverLicense"] integerValue] == 0 || response[@"driverLicense"] == NULL) {
//            _vehicleJiaShiZhengTFView.hidden = YES;
            _driverLicenseContainerView.hidden = YES;
        }
        if ([response[@"vehicleLicense"] integerValue] == 0 || response[@"vehicleLicense"] == NULL) {
//            _vehicleXingShiZhengTFView.hidden = YES;
            _vehicleLicenseContainerView.hidden = YES;
        }
        if ([response[@"realOwner"] integerValue] == 0 || response[@"realOwner"] == NULL) {
//            _vehicleActualOwnerAsterisk.hidden = YES;
            _vehicleActualOwnerView.hidden = YES;
        }
        if ([response[@"realOwnerPhone"] integerValue] == 0 || response[@"realOwnerPhone"] == NULL) {
//            _vehicleActualOwnerPhoneAsterisk.hidden = YES;//车辆实际所有人联系方式
            _vehicleActualOwnerPhoneView.hidden = YES;
        }
        if ([response[@"areaList"] integerValue] == 0 || response[@"areaList"] == NULL) {
//            _tongXunDiZhiTFView.hidden = YES;//通讯地址
            _areaListContainerView.hidden = YES;
        }
        if ([response[@"classificationCode"] integerValue] == 0 || response[@"classificationCode"] == NULL) {
//            _vehicleTypeTFView.hidden = YES;
            _classificationCodeContainerView.hidden = YES;
        }
        if ([response[@"loadWeight"] integerValue] == 0 || response[@"loadWeight"] == NULL) {
//            _vehicleLoadWeightTFView.hidden = YES;
            _loadWeightContainerView.hidden = YES;
        }
        if ([response[@"totalWeight"] integerValue] == 0 || response[@"totalWeight"] == NULL) {
//            _vehicleTotaleightTFView.hidden = YES;
            _totalWeightContainerView.hidden = YES;
        }
        if ([response[@"vehicleLicenseColor"] integerValue] == 0 || response[@"vehicleLicenseColor"] == NULL) {
//            _licensePlateColorTFView.hidden = YES;
            _vehicleLicenseColorContainerView.hidden = YES;
        }
        if ([response[@"vehicleEnergyType"] integerValue] == 0 || response[@"vehicleEnergyType"] == NULL) {
//            _vehicleEnergyTypesTFView.hidden = YES;//车辆能源类型
            _vehicleEnergyTypeContainerView.hidden = YES;
        }
        if ([response[@"vehicleLicenseDueDate"] integerValue] == 0 || response[@"vehicleLicenseDueDate"] == NULL) {
//            _xingShiZhengEndDateTFView.hidden = YES;//行驶证到期日期
            _vehicleLicenseDueDateContainerView.hidden = YES;
        }
        if ([response[@"idCardDueDate"] integerValue] == 0 || response[@"idCardDueDate"] == NULL) {
//            _idCardDueDateView.hidden = YES;//身份证到期日期
            _idCardDueDateContainerView.hidden = YES;
        }
        if ([response[@"sex"] integerValue] == 0 || response[@"sex"] == NULL) {
//            _sexView.hidden = YES;//性别
            _sexHiddenFlag = YES;
            _sexBgView.hidden = YES;
        }
        if ([response[@"axlenum"] integerValue] == 0 || response[@"axlenum"] == NULL) {
//            _axlenumTFView.hidden = YES;//车轴
            _axlenumHiddenFlag = YES;
            _axlenumBgView.hidden = YES;
        }
        if ([response[@"brand"] integerValue] == 0 || response[@"brand"] == NULL || _isTax == 0) {
//            _vehicleBrandAsterisk.hidden = YES;//车辆品牌
            _vehicleBrandBgView.hidden = YES;
        }
        
        //挂车区域（该字段后端未做控制默认一直显示）
        if ([response[@"isHasTrailer"] integerValue] == 0 || response[@"isHasTrailer"] == NULL) {
            _trailerBgView.hidden = YES;
//            _isHasTrailerContainerView.hidden = YES;
        }
        
        if ([response[@"trailerNum"] integerValue] == 0 || response[@"trailerNum"] == NULL) {
//            _trailerNumTFView.hidden = YES;//挂车车牌
            _trailerNumContainerView.hidden = YES;
        }
        if ([response[@"trailerLicenseColor"] integerValue] == 0 || response[@"trailerLicenseColor"] == NULL) {
//            _trailerLicenseColorTFView.hidden = YES;
            _trailerLicenseColorContainerView.hidden = YES;
        }
        if ([response[@"trailerClassificationCode"] integerValue] == 0 || response[@"trailerClassificationCode"] == NULL) {
//            _trailerTypeTFView.hidden = YES;
            _trailerClassificationCodeContainerView.hidden = YES;
        }
        if ([response[@"trailerRoadTransport"] integerValue] == 0 || response[@"trailerRoadTransport"] == NULL) {
//            _trailerDaoLuYunShuZhengTFView.hidden = YES;//挂车道路运输证
            _trailerRoadTransportContainerView.hidden = YES;
        }
        if ([response[@"trailerTotalWeight"] integerValue] == 0 || response[@"trailerTotalWeight"] == NULL) {
//            _trailerTotalWeightView.hidden = YES;//挂车总重量
            _trailerTotalWeightContainerView.hidden = YES;
        }
        if ([response[@"trailerLoadWeight"] integerValue] == 0 || response[@"trailerLoadWeight"] == NULL) {
//            _trailerLoadWeightView.hidden = YES;//挂车核定载质量
            _trailerLoadWeightContainerView.hidden = YES;
        }
        if ([response[@"trailerVehicleLicenseImg"] integerValue] == 0 || response[@"trailerVehicleLicenseImg"] == NULL) {
//            _trailerXingShiZhengBtnView.hidden = YES;//挂车行驶证正页图片
            _trailerVehicleLicenseImgContainerView.hidden = YES;
        }
        if ([response[@"trailerVehicleLicenseDeputyPageImg"] integerValue] == 0 || response[@"trailerVehicleLicenseDeputyPageImg"] == NULL) {
//            _trailerVehicleLicenseDeputyPageImgBtnView.hidden = YES;//挂车行驶证副页图片
            _trailerVehicleLicenseDeputyPageImgContainerView.hidden = YES;
        }
        if ([response[@"trailerVehicleImg"] integerValue] == 0 || response[@"trailerVehicleImg"] == NULL) {
//            _trailerZhaoBtnView.hidden = YES;//挂车照片
            _trailerVehicleImgContainerView.hidden = YES;
        }
        if ([response[@"trailerRoadTransportCertificateImg"] integerValue] == 0 || response[@"trailerRoadTransportCertificateImg"] == NULL) {
//            _trailerDaoLuYunShuZhengBtnView.hidden = YES;//挂车道路运输证照片
            _trailerRoadTransportCertificateImgContainerView.hidden = YES;
        }
        
        
        //非必填区域
        if ([response[@"selfRespect"] integerValue] == 0) {
            _otherContainerView.hidden = YES;
        }
        
        if ([response[@"roadTransportCertificateDate"] integerValue] == 0 || response[@"roadTransportCertificateDate"] == NULL) {
//            _roadTransportCertificateDateTFView.hidden = YES;//道路运输证到期日期
            _roadTransportCertificateDateContainerView.hidden = YES;
        }
        if ([response[@"workLicenseDueDate"] integerValue] == 0 || response[@"workLicenseDueDate"] == NULL) {
//            _workLicenseDueDateTFView.hidden = YES;//道路运输从业资格证到期日期
            _workLicenseDueDateContainerView.hidden = YES;
        }
        if ([response[@"selfRespect"] integerValue] == 0 || response[@"selfRespect"] == NULL) {
//            _selfRespectTFView.hidden = YES;//车身自重
            _selfRespectContainerView.hidden = YES;
        }
        if ([response[@"dimension"] integerValue] == 0 || response[@"dimension"] == NULL) {
//            _carSizeView.hidden = YES;//外廓尺寸
            _dimensionContainerView.hidden = YES;
        }
        
        //小于4.5吨区域
        if ([response[@"issueDate"] integerValue] == 0 &&
            [response[@"registerDate"] integerValue] == 0 &&
            [response[@"vehicleIssuingOrganizations"] integerValue] == 0 &&
            [response[@"vin"] integerValue] == 0 &&
            [response[@"useCharacter"] integerValue] == 0 &&
            [response[@"driverLicenseFromDate"] integerValue] == 0 &&
            [response[@"driverIssuingOrganizations"] integerValue] == 0 &&
            [response[@"vehicleClass"] integerValue] == 0
            ) {
            _p45ContainerView.hidden = YES;
        }
        if ([response[@"driverIssuingOrganizations"] integerValue] == 0 || response[@"driverIssuingOrganizations"] == NULL) {
//            _jiaShiZhengFaZhengJiGuanTFView.hidden = YES;//驾驶证发证机关
            _driverIssuingOrganizationsContainerView.hidden = YES;
        }
        if ([response[@"vehicleIssuingOrganizations"] integerValue] == 0 || response[@"vehicleIssuingOrganizations"] == NULL) {
//            _xingShiZhengFaZhengJiGuanTFView.hidden = YES;//行驶证发证机关
            _vehicleIssuingOrganizationsContainerView.hidden = YES;
        }
        if ([response[@"vin"] integerValue] == 0 || response[@"vin"] == NULL) {
//            _cheLiangShiBieVINTFView.hidden = YES;//车辆识别代码
            _vinContainerView.hidden = YES;
        }
        if ([response[@"useCharacter"] integerValue] == 0 || response[@"useCharacter"] == NULL) {
//            _shiYongXingZhiTFView.hidden = YES;//使用性质
            _useCharacterContainerView.hidden = YES;
        }
        if ([response[@"vehicleClass"] integerValue] == 0 || response[@"vehicleClass"] == NULL) {
//            _zhunJiavehicleTypeTFView.hidden = YES;//准驾车型
            _vehicleClassContainerView.hidden = YES;
        }
        if ([response[@"driverLicenseFromDate"] integerValue] == 0 || response[@"driverLicenseFromDate"] == NULL) {
//            _driverLicenseFromDateTFView.hidden = YES;//驾驶证有效期开始
            _driverLicenseFromDateContainerView.hidden = YES;
        }
        if ([response[@"driverLicenseDueDate"] integerValue] == 0 || response[@"driverLicenseDueDate"] == NULL) {
//            _driverLicenseDueDateTFView.hidden = YES;//驾驶证到期日期
            _driverLicenseDueDateContainerView.hidden = YES;
        }
        if ([response[@"registerDate"] integerValue] == 0 || response[@"registerDate"] == NULL) {
//            _registerDateTFView.hidden = YES;//注册日期
            _registerDateContainerView.hidden = YES;
        }
        if ([response[@"issueDate"] integerValue] == 0 || response[@"issueDate"] == NULL) {
//            _issueDateTFView.hidden = YES;//发证日期
            _issueDateContainerView.hidden = YES;
        }
        
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

#pragma mark - 获取认证信息请求
- (void)getAuthDetailInfoRequest {
    //    WEAKSELF
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], DRIVER_INFO) withParameter:@{ @"token":[UserDefaultUtil valueForKey:USER_TOKEN],} withVC:self netName:@"司机认证信息获取" success:^(id response, NSString *msg) {
        
        // 审核状态
        NSInteger authStatus = [response[@"authStatus"] integerValue];
        _authStateLabel.text = [StatusTextJudge authStatusJudge:authStatus];
        if (authStatus == 3) {//审核通过车辆不允许修改
            _editView.hidden = YES;
        }
        if (authStatus == 2) {
            _authStateDetailLabel.text = [@"驳回原因:" stringByAppendingString:[NSString nullToString:CJStringWithFormat(@"%@", response[@"authMsg"])]];
            [_authTopImageView setImage:[UIImage imageNamed:@"gcy_img_ban_bg"]];
            _authStateLabel.textColor = [UIColor redColor];
        }
        
        NSInteger isHaveTra = [[NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"isHasTrailer"])] integerValue];
        if (isHaveTra == 1) {
            _isTrailer = YES;
            _trailerBgView.hidden = NO;
            _trailerImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
            _vehicleTotalWeightTextLab.text = @"挂车车头整备质量(kg)";
            _vehicleTotaleightTF.placeholder = @"请填写挂车车头整备质量";
            _vehicleLoadWeightTextLab.text = @"准牵引总质量(kg)";
            _vehicleLoadWeightTF.placeholder = @"请填写准牵引总质量";
        }
        _trailerBgView.hidden = YES;
        
        //性别
        _sex = [NSString nullToString:CJStringWithFormat(@"%@", response[@"sex"])];
        if ([_sex isEqual:@"1"]) {
            _manImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        } else if ([_sex isEqual:@"2"]) {
            _womenImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        }
        
        //身份证有效期是否长期
        if ([response[@"idCardDueDate"] isEqual:@"9999-12-31"]) {
            _idCardIsLongtime = YES;
            _idCardDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        } else {
            _idCardIsLongtime = NO;
            _idCardDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
        }
        //司机驾驶证是否长期
        if ([response[@"driverLicenseDueDate"] isEqual:@"9999-12-31"]) {
            _licenseIsLongtime = YES;
            _driverLicenseDueDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        } else {
            _licenseIsLongtime = NO;
            _driverLicenseDueDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
        }
        
        _axlenumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"axlenum"])];//车轴
        _nameTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"name"])];
        _phoneTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"phone"])];
        _idCardTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"identificationNumber"])];
        _idCardDueDateTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"idCardDueDate"])];//身份证有效期
        _lastIdardDueDate = [NSString nullToString:CJStringWithFormat(@"%@", response[@"idCardDueDate"])];
        _chePaiNumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"licenseNumber"])];
        _vehicleBrandTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"brand"])];//车辆品牌
        _cheLiangDaoLuYunShuNumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"roadTransportCertificateNumber"])];
        _daoLuYunShuJingYingNumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"roadPermitNumber"])];//道路运输经营许可证
        _roadPermitNameTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"roadPermitName"])];//道路运输经营许可证业户名称
        _daoLuYunShuCongYeNumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"workLicense"])];//道路运输从业资格证
        _detailAddressTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"homeAddress"])];//详细地址
        _workUnitTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"workCompany"])];//工作单位
        _vehicleOwnerTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"owner"])];//车辆所有人
        _vehicleJiaShiZhengTF.text = [NSString nullToString: response[@"driverLicense"]];//驾驶证
        _vehicleXingShiZhengTF.text = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicense"]];//行驶证
        _vehicleActualOwnerTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"realOwner"])];//车辆实际所有人
        _vehicleActualOwnerPhoneTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"vehicleVO"][@"realOwnerPhone"])];//车辆实际所有人联系方式
        
        //选择器数据
        _tongXunDiZhiTF.text = [NSString nullToString:CJStringWithFormat(@"%@%@%@", response[@"provinceName"],response[@"cityName"],response[@"countyName"])];//通讯地址
        _vehicleTypeTF.text = [NSString nullToString: response[@"vehicleClassificationName"]];//车辆分类
        _vehicleLoadWeightTF.text = [NSString nullToString: response[@"vehicleVO"][@"loadWeight"]];//载重
        _vehicleTotaleightTF.text = [NSString nullToString: response[@"vehicleVO"][@"totalWeight"]];//总重
        _licensePlateColorTF.text = [NSString nullToString: response[@"vehicleLicenseColorName"]];//车牌颜色
        _vehicleEnergyTypesTF.text = [NSString nullToString: response[@"vehicleEnergyTypeName"]];//车辆能源典名称
        _xingShiZhengEndDateTF.text = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicenseDueDate"]];//行驶证到期日期

        _provinceCode = [NSString nullToString:CJStringWithFormat(@"%@", response[@"provinceCode"])];//省
        _cityCode = [NSString nullToString:CJStringWithFormat(@"%@", response[@"cityCode"])];//市
        _countyCode = [NSString nullToString:CJStringWithFormat(@"%@", response[@"countyCode"])];//区
        _classificationCode = [NSString nullToString: response[@"vehicleVO"][@"classificationCode"]];//车辆分类
        _loadWeight = [NSString nullToString: response[@"vehicleVO"][@"loadWeight"]];
        _totalWeight = [NSString nullToString: response[@"vehicleVO"][@"totalWeight"]];
        
        _vehicleLicenseColor = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicenseColor"]];
        _vehicleEnergyType = [NSString nullToString: response[@"vehicleVO"][@"vehicleEnergyType"]];
        _totalWeightNum = [response[@"vehicleVO"][@"totalWeight"] floatValue];
        NSInteger isGuaKao = [response[@"vehicleVO"][@"isLinked"] integerValue];//司机是否挂靠
        
        if (isGuaKao == 1) {
            _affiliatedImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
            _depenDealImgView.hidden = NO;
            _depenDealImgAsterisk.hidden = NO;
            _isLinked = YES;
        } else {
            _affiliatedImageView.image = image(@"gcy_img_home_business_nomal");
            _depenDealImgView.hidden = YES;
            _depenDealImgAsterisk.hidden = YES;
            _isLinked = NO;
        }
        
        //总重小于4.5吨的
        _jiaShiZhengFaZhengJiGuanTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"issuingOrganizations"])];//驾驶证发证机关
        _xingShiZhengFaZhengJiGuanTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"issuingOrganizations"])];//行驶证发证机关
        _cheLiangShiBieVINTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"vin"])];//vin
        _shiYongXingZhiTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"useCharacter"])];//使用性质
        _zhunJiavehicleTypeTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleClass"])];//准驾车型
        _driverLicenseFromDateTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"driverLicenseFromDate"])];//驾照有效期自
        _driverLicenseDueDateTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"driverLicenseDueDate"])];//司机驾驶证到期日期
        _lastDriverLicenseDueDate = [NSString nullToString:CJStringWithFormat(@"%@",response[@"driverLicenseDueDate"])];
        _registerDateTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"registerDate"])];//注册日期
        _issueDateTF.text = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleVO"][@"issueDate"])];//发证日期
        
        _vehicleClass = [NSString nullToString:CJStringWithFormat(@"%@",response[@"vehicleClass"])];
        
        //选填区域
        _roadTransportCertificateDateTF.text = [NSString nullToString: response[@"vehicleVO"][@"roadTransportCertificateDate"]];//道路运输证到期日期
        _workLicenseDueDateTF.text = [NSString nullToString: response[@"workLicenseDueDate"]];//道路运输从业资格证到期日期
        _selfRespectTF.text = [NSString nullToString: response[@"vehicleVO"][@"selfRespect"]];//车身自重
        _selfRespect = [NSString nullToString: response[@"vehicleVO"][@"selfRespect"]];//车身自重
        _carLengthLabel.text = [DCSpeedy isBlankString:response[@"vehicleVO"][@"length"]] ? @"" : [NSString nullToString: response[@"vehicleVO"][@"length"]];//车辆长
        _carWidthLabel.text = [DCSpeedy isBlankString:response[@"vehicleVO"][@"width"]] ? @"" : [NSString nullToString: response[@"vehicleVO"][@"width"]];//车辆宽
        _carHeightLabel.text = [DCSpeedy isBlankString:response[@"vehicleVO"][@"height"]] ? @"" : [NSString nullToString: response[@"vehicleVO"][@"height"]];//车辆高
        _vehicleLength = [NSString nullToString: response[@"vehicleVO"][@"length"]];
        _vehicleWidth = [NSString nullToString: response[@"vehicleVO"][@"width"]];
        _vehicleHeight= [NSString nullToString: response[@"vehicleVO"][@"height"]];
        _xingShiZhengEndDateTF.text = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicenseDueDate"]];//行驶证到期日期
        
        //挂车信息区域
        _trailerNumTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerNum"]];//挂车车牌
        _trailerLicenseColorTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerLicenseColorName"]];//挂车车牌颜色
        _trailerLicenseColor = [NSString nullToString: response[@"vehicleVO"][@"trailerLicenseColor"]];
        _trailerTypeTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerClassificationName"]];//挂车车辆类型
        _trailerClassificationCode = [NSString nullToString: response[@"vehicleVO"][@"trailerClassificationCode"]];
        _trailerDaoLuYunShuZhengTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerRoadTransport"]];//挂车道路运输证
        _trailerTotalWeightTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerTotalWeight"]];//挂车总质量
        _trailerLoadWeightTF.text = [NSString nullToString: response[@"vehicleVO"][@"trailerLoadWeight"]];//挂车载重
        _trailerVehicleLicenseImg = [NSString nullToString: response[@"vehicleVO"][@"trailerVehicleLicenseImg"]];//挂车行驶证照片
        _trailerVehicleImg = [NSString nullToString: response[@"vehicleVO"][@"trailerVehicleImg"]];//挂车照
        _trailerRoadTransportCertificateImg = [NSString nullToString: response[@"vehicleVO"][@"trailerRoadTransportCertificateImg"]];
        _trailerVehicleLicenseDeputyPageImg = [NSString nullToString: response[@"vehicleVO"][@"trailerVehicleLicenseDeputyPageImg"]];//挂车行驶证照副页照
        
        if ([DCSpeedy isBlankString:_trailerVehicleLicenseImg] == NO) {
            [_trailerXingShiZhengBtn setTitle:@"挂车行驶证正页照片已上传" forState:UIControlStateNormal];
            [_trailerXingShiZhengBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_trailerVehicleLicenseDeputyPageImg] == NO) {
            [_trailerVehicleLicenseDeputyPageImgBtn setTitle:@"挂车行驶证副页照片已上传" forState:UIControlStateNormal];
            [_trailerVehicleLicenseDeputyPageImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_trailerVehicleImg] == NO) {
            [_trailerZhaoBtn setTitle:@"挂车照片已上传" forState:UIControlStateNormal];
            [_trailerZhaoBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_trailerRoadTransportCertificateImg] == NO) {
            [_trailerDaoLuYunShuZhengBtn setTitle:@"挂车道路运输证照片已上传" forState:UIControlStateNormal];
            [_trailerDaoLuYunShuZhengBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        
        //照片区域
        _vehicleLicenseImg = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicenseImg"]];//行驶证照片
        _vehicleLicenseDeputyPageImg = [NSString nullToString: response[@"vehicleVO"][@"vehicleLicenseDeputyPageImg"]];//行驶证副页照片
        _driverLicenseImg = [NSString nullToString: response[@"driverLicenseImg"]];//驾驶证照片
        _identificationImg = [NSString nullToString: response[@"identificationImg"]];
        _identificationBackImg = [NSString nullToString: response[@"identificationBackImg"]];
        _roadTransportCertificateImg = [NSString nullToString: response[@"vehicleVO"][@"roadTransportCertificateImg"]];//道路运输证
        _workLicenseImg = [NSString nullToString: response[@"workLicenseImg"]];//道路运输从业资格证
        _roadPerExpiryDateImg = [NSString nullToString: response[@"roadPerExpiryDateImg"]];//道路运输证到期图片
        _driverImg = [NSString nullToString: response[@"driverImg"]];//司机照
        _roadPermitNumberImg =  [NSString nullToString: response[@"vehicleVO"][@"roadPermitNumberImg"]];//道路运输经营许可证照片
        _vehicleImg =  [NSString nullToString: response[@"vehicleVO"][@"vehicleImg"]];//车辆照片
        _safeDutyInsureImg =  [NSString nullToString: response[@"safeDutyInsureImg"]];//安全责任险
        _depenDealImg =  [NSString nullToString: response[@"vehicleVO"][@"depenDealImg"]];//挂靠协议
        _stateImg = [NSString nullToString: response[@"vehicleVO"][@"stateImg"]];//车主声明照
        
        if ([DCSpeedy isBlankString:_vehicleLicenseImg] == NO) {
            [_vehicleLicenseBtn setTitle:@"车辆行驶证正页照片已上传" forState:UIControlStateNormal];
            [_vehicleLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_vehicleLicenseDeputyPageImg] == NO) {
            [_vehicleLicenseDeputyPageBtn setTitle:@"车辆行驶证副页照片已上传" forState:UIControlStateNormal];
            [_vehicleLicenseDeputyPageBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_driverLicenseImg] == NO) {
            [_driverLicenseBtn setTitle:@"机动车驾驶证正副页拍照已上传" forState:UIControlStateNormal];
            [_driverLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_identificationImg] == NO) {
            [_identificationBtn setTitle:@"司机身份证人像面照片已上传" forState:UIControlStateNormal];
            [_identificationBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_identificationBackImg] == NO) {
            [_identificationBackBtn setTitle:@"司机身份证国徽面照片已上传" forState:UIControlStateNormal];
            [_identificationBackBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_roadTransportCertificateImg] == NO) {
            [_roadTransportCertificateBtn setTitle:@"道路运输证照片已上传" forState:UIControlStateNormal];
            [_roadTransportCertificateBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_workLicenseImg] == NO) {
            [_workLicenseBtn setTitle:@"从业资格证照片已上传" forState:UIControlStateNormal];
            [_workLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_driverImg] == NO) {
            [_driverImgBtn setTitle:@"司机半身照已上传" forState:UIControlStateNormal];
            [_driverImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_roadPermitNumberImg] == NO) {
            [_roadPermitBtn setTitle:@"道路运输经营许可证照片已上传" forState:UIControlStateNormal];
            [_roadPermitBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_vehicleImg] == NO) {
            [_vehicleImgBtn setTitle:@"车辆照片已上传" forState:UIControlStateNormal];
            [_vehicleImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_safeDutyInsureImg] == NO) {
            [_safeDutyInsureImgBtn setTitle:@"安全责任险照片已上传" forState:UIControlStateNormal];
            [_safeDutyInsureImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_depenDealImg] == NO) {
            [_depenDealImgBtn setTitle:@"挂靠协议照片已上传" forState:UIControlStateNormal];
            [_depenDealImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        if ([DCSpeedy isBlankString:_stateImg] == NO) {
            [_stateImgBtn setTitle:@"车主声明照片已上传" forState:UIControlStateNormal];
            [_stateImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
        }
        
        
#pragma mark - 证件是否过期判断(司机认证涉及4种证件)
        //身份证是否到期
        if (response[@"idCardDueDate"] != NULL) {
            
            NSInteger delta = [DCSpeedy calculateTimeDifference:response[@"idCardDueDate"]];

            if (delta<=30) {
                _idCardDueDateRemindLabel.hidden = NO;
                [_identificationBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                [_identificationBackBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                _idCardDueDateTF.textColor = Red_Color;
            } else {
                _idCardDueDateRemindLabel.hidden = YES;
            }
        }
        
        if ([DCSpeedy isBlankArr:response[@"overDueType"]] == NO) {
            NSArray *overDueArr = response[@"overDueType"];
            [overDueArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if ([obj containsString:@"work"]) {
                    //道路运输从业资格证
                    [_workLicenseBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                    _workLicenseDueDateTF.textColor = Red_Color;
                } else if ([obj containsString:@"driver"]) {
                    //司机驾驶证
                    [_driverLicenseBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                    _driverLicenseDueDateTF.textColor = Red_Color;
                } else if ([obj containsString:@"road"]) {
                    //道路运输证
                    [_roadTransportCertificateBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                    _roadTransportCertificateDateTF.textColor = Red_Color;
                } else if ([obj containsString:@"vehicle"]) {
                    //行驶证
                    [_vehicleLicenseBtn setTitleColor:Red_Color forState:UIControlStateNormal];
                    _xingShiZhengEndDateTF.textColor = Red_Color;
                }
            }];
        }
        
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

#pragma mark -- 图片上传成功回调
- (void)getImageUrlSting:(NSString *)string andImageType:(NSInteger)type {
    
    NSString *ocrType = @"";
    
    if (type == 5) {
        //行驶证
        ocrType = @"ocrVehicleLicense";
        _vehicleLicenseImg = string;
        [_vehicleLicenseBtn setTitle:@"车辆行驶证正页照片已上传" forState:UIControlStateNormal];
        [_vehicleLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 18) {
        //行驶证副页
        ocrType = @"ocrVehicleLicenseBack";
        _vehicleLicenseDeputyPageImg = string;
        [_vehicleLicenseDeputyPageBtn setTitle:@"车辆行驶证副页照片已上传" forState:UIControlStateNormal];
        [_vehicleLicenseDeputyPageBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 0) {
        //驾驶证
        ocrType = @"ocrDrivingLicense";
        _driverLicenseImg = string;
        [_driverLicenseBtn setTitle:@"机动车驾驶证正副页拍照已上传" forState:UIControlStateNormal];
        [_driverLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 2) {
        ocrType = @"ocrIdidentityCardFront";
        _identificationImg = string;
        [_identificationBtn setTitle:@"司机身份证人像面照片已上传" forState:UIControlStateNormal];
        [_identificationBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 3) {
        ocrType = @"ocrIdidentityCardFrontBack";
        _identificationBackImg = string;
        [_identificationBackBtn setTitle:@"司机身份证国徽面照片已上传" forState:UIControlStateNormal];
        [_identificationBackBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 6) {
        //车辆道路运输证
        ocrType = @"ocrRoadTransportCertificate";
        _roadTransportCertificateImg = string;
        [_roadTransportCertificateBtn setTitle:@"道路运输证照片已上传" forState:UIControlStateNormal];
        [_roadTransportCertificateBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 1) {
        //道路运输从业资格证
        ocrType = @"ocrQualificationCertificate";
        _workLicenseImg = string;
        [_workLicenseBtn setTitle:@"从业资格证照片已上传" forState:UIControlStateNormal];
        [_workLicenseBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 4) {
        _driverImg = string;
        [_driverImgBtn setTitle:@"司机半身照已上传" forState:UIControlStateNormal];
        [_driverImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 13) {
        //道路运输经营许可证
        ocrType = @"ocrRoadPermitNumber";
        _roadPermitNumberImg = string;
        [_roadPermitBtn setTitle:@"道路运输经营许可证照片已上传" forState:UIControlStateNormal];
        [_roadPermitBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 14) {
        _vehicleImg = string;
        [_vehicleImgBtn setTitle:@"车辆照片已上传" forState:UIControlStateNormal];
        [_vehicleImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 15) {
        _safeDutyInsureImg = string;
        [_safeDutyInsureImgBtn setTitle:@"安全责任险照片已上传" forState:UIControlStateNormal];
        [_safeDutyInsureImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 16) {
        _depenDealImg = string;
        [_depenDealImgBtn setTitle:@"挂靠协议照片已上传" forState:UIControlStateNormal];
        [_depenDealImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 17) {
        _stateImg = string;
        [_stateImgBtn setTitle:@"车主声明照片已上传" forState:UIControlStateNormal];
        [_stateImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 12) {
        _trailerVehicleImg = string;
        [_trailerZhaoBtn setTitle:@"挂车照片已上传" forState:UIControlStateNormal];
        [_trailerZhaoBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 9) {
        _trailerRoadTransportCertificateImg = string;
        [_trailerDaoLuYunShuZhengBtn setTitle:@"挂车道路运输证照片已上传" forState:UIControlStateNormal];
        [_trailerDaoLuYunShuZhengBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 8) {
        _trailerVehicleLicenseImg = string;
        [_trailerXingShiZhengBtn setTitle:@"挂车行驶证正页照片已上传" forState:UIControlStateNormal];
        [_trailerXingShiZhengBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    } else if (type == 19) {
        _trailerVehicleLicenseDeputyPageImg = string;
        [_trailerVehicleLicenseDeputyPageImgBtn setTitle:@"挂车行驶证副页照片已上传" forState:UIControlStateNormal];
        [_trailerVehicleLicenseDeputyPageImgBtn setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    }
    
#pragma mark - OCR识别
//    if (type == 2 || type == 3 || type == 6 || type == 13 || type == 1 || type == 0 || type == 5 || type == 18) {
        if (type == 6 || type == 13 || type == 1 || type == 0 || type == 5 || type == 18) {
        
        NSDictionary *parmas = @{
            @"image": string,
            @"ocrType": ocrType,
            @"token":[UserDefaultUtil valueForKey:USER_TOKEN],
        };
        
        [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-tps-api",[ReAddressDynamic shared].baseUrl], NTOCC_OCRCARD) withParameter:parmas withVC:self netName:@"OCR识别" success:^(id response, NSString *msg) {
            
            [XSInfoView showInfo:msg onView:self.view];
            
            if (type == 2) {
                //身份证
                if ([DCSpeedy isBlankString:response[@"name"]] == NO) {
                    _nameTF.text = response[@"name"];
                }
                if ([DCSpeedy isBlankString:response[@"identity"]] == NO) {
                    _idCardTF.text = response[@"identity"];
                }
                if ([DCSpeedy isBlankString:response[@"provinceCode"]] == NO) {
                    _provinceCode = response[@"provinceCode"];
                }
                if ([DCSpeedy isBlankString:response[@"cityCode"]] == NO) {
                    _cityCode = response[@"cityCode"];
                }
                if ([DCSpeedy isBlankString:response[@"countyCode"]] == NO) {
                    _countyCode = response[@"countyCode"];
                }
                if ([DCSpeedy isBlankString:response[@"provinceName"]] == NO && [DCSpeedy isBlankString:response[@"cityName"]] == NO && [DCSpeedy isBlankString:response[@"countyName"]] == NO) {
                    NSString *address = CJStringWithFormat(@"%@%@%@", response[@"provinceName"], response[@"cityName"], response[@"countyName"]);
                    _tongXunDiZhiTF.text = address;
                }
                if ([DCSpeedy isBlankString:response[@"address"]] == NO) {
                    _detailAddressTF.text = response[@"address"];
                }
                
                
            } else if (type == 3) {
                //身份证反面
                if ([DCSpeedy isBlankString:response[@"expiryDate"]] == NO && ([response[@"expiryDate"] isEqual:@"长期"] || [response[@"expiryDate"] isEqual:@"9999-12-31"])) {
                    _idCardIsLongtime = YES;
                    _idCardDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
                    _idCardDueDateTF.text = @"9999-12-31";
                } else {
                    _idCardIsLongtime = NO;
                    _idCardDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
                    _idCardDueDateTF.text = [DCSpeedy ocrDateFormatter:response[@"expiryDate"]];
                }
                
            } else if (type == 6) {
                //车辆运输证
                //车辆道路运输证号
                if ([DCSpeedy isBlankString:response[@"hao"]] == NO) {
                    _cheLiangDaoLuYunShuNumTF.text = [NSString nullToString:CJStringWithFormat(@"%@", response[@"hao"])];
                }
                
            } else if (type == 13) {
                //道路运输经营许可证
                if ([DCSpeedy isBlankString:response[@"hao"]] == NO) {
                    _daoLuYunShuJingYingNumTF.text = response[@"hao"];
                }
                if ([DCSpeedy isBlankString:response[@"yehumingcheng"]] == NO) {
                    _roadPermitNameTF.text = response[@"yehumingcheng"];
                }
            } else if (type == 1) {
                //道路运输从业资格证
                if ([DCSpeedy isBlankString:response[@"zhenghao"]] == NO) {
                    _daoLuYunShuCongYeNumTF.text = response[@"zhenghao"];
                }
                if ([DCSpeedy isBlankString:response[@"youxiaoqixian"]] == NO) {
                    
                    if ([[DCSpeedy ocrDateFormatter:response[@"youxiaoqixian"]] isEqual:@""]) {
                        _workLicenseDueDateTF.text = @"";
                    } else {
                        _workLicenseDueDateTF.text = [DCSpeedy ocrDateFormatter:response[@"youxiaoqixian"]];
                    }
                    
                }
                
            } else if (type == 0) {
                //驾驶证
                if ([DCSpeedy isBlankString:response[@"certificateNumber"]] == NO) {
                    _vehicleJiaShiZhengTF.text = response[@"certificateNumber"];
                }
                
                //准驾车型
                if ([DCSpeedy isBlankString:response[@"vehicleClass"]] == NO && [DCSpeedy isBlankString:response[@"vehicleClassName"]] == NO) {
                    _vehicleClass = response[@"vehicleClass"];
                    _zhunJiavehicleTypeTF.text = response[@"vehicleClassName"];
                }
                
                //驾驶证发证机关
                
                //驾驶证有效期自
                if ([DCSpeedy isBlankString:response[@"validStartDate"]] == NO) {
                    _driverLicenseFromDateTF.text = [DCSpeedy ocrDateFormatter:response[@"validStartDate"]];
                }
                
                //驾驶证有效期至(判断了是否是长期)
                if ([DCSpeedy isBlankString:response[@"validDate"]] == NO && ([response[@"validDate"] isEqual:@"长期"] || [response[@"validDate"] isEqual:@"9999-12-31"])) {
                    _licenseIsLongtime = YES;
                    _driverLicenseDueDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
                    _driverLicenseDueDateTF.text = @"9999-12-31";
                } else {
                    _licenseIsLongtime = NO;
                    _driverLicenseDueDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
                    _driverLicenseDueDateTF.text = [DCSpeedy ocrDateFormatter:response[@"validDate"]];
                }
            
                
            } else if (type == 5) {
                //行驶证
                //车辆牌照号、
                if ([DCSpeedy isBlankString:response[@"plateNumber"]] == NO) {
                    _chePaiNumTF.text = response[@"plateNumber"];
                }
                
                //车辆所有人、
                if ([DCSpeedy isBlankString:response[@"owner"]] == NO) {
                    _vehicleOwnerTF.text = response[@"owner"];
                }
                
                //使用性质、
                if ([DCSpeedy isBlankString:response[@"useNature"]] == NO) {
                    _shiYongXingZhiTF.text = response[@"useNature"];
                }
                
                //车辆识别码VIN
                if ([DCSpeedy isBlankString:response[@"identificationNumber"]] == NO) {
                    _cheLiangShiBieVINTF.text = response[@"identificationNumber"];
                }
                
                //发证机关、
                
                
                //注册日期、convertStrToTime
                if ([DCSpeedy isBlankString:response[@"registrationDate"]] == NO) {
                    _registerDateTF.text = [DCSpeedy ocrDateFormatter:response[@"registrationDate"]];
                }
                
                //发证日期
                if ([DCSpeedy isBlankString:response[@"dateOfIssue"]] == NO) {
                    _issueDateTF.text = [DCSpeedy ocrDateFormatter:response[@"dateOfIssue"]];
                }
                
            } else if (type == 18) {
                //行驶证副页
                //能源类型
                if (![DCSpeedy isBlankString:response[@"fuelType"]]) {
                    _vehicleEnergyTypesTF.text = response[@"fuelType"];
                }
                //车身自重
                if (![DCSpeedy isBlankString:response[@"curbWeight"]]) {
                    NSString *str = response[@"curbWeight"];
                    if (str.length>2) {
                        _selfRespectTF.text = [str substringToIndex:str.length-2];
                    }
                }
                //车辆总质量
                if (![DCSpeedy isBlankString:response[@"tractionMass"]]) {
                    NSString *str = response[@"tractionMass"];
                    if (str.length>2) {
                        _vehicleTotaleightTF.text = [str substringToIndex:str.length-2];
                    }
                }
                //外廓尺寸7620X2400X3600mm
                if (![DCSpeedy isBlankString:response[@"gabarite"]]) {
                    NSArray *array = [response[@"gabarite"] componentsSeparatedByString:@"X"];
                    if (array.count>2) {
                        _carLengthLabel.text = array[0];//车辆长度
                        _carWidthLabel.text = array[1];//车辆宽度
                        NSString *hStr = array[2];
                        if (hStr.length>2 && ![DCSpeedy isBlankString:response[@"gabarite"]]) {
                            _carHeightLabel.text = [hStr substringToIndex:hStr.length-2];//车辆高度
                        }
                    }

                }
            }
            
        } failure:^(NSInteger code, NSString *msg) {
            
        }];
        
    }
    
}

- (void)vehicleLicenseBtnEvent {
    self.uploadImgVC.imageType = 5;
    self.uploadImgVC.imageNetUrl = _vehicleLicenseImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)driverLicenseBtnEvent {
    //驾驶证
    self.uploadImgVC.imageType = 0;
    self.uploadImgVC.imageNetUrl = _driverLicenseImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)identificationBtnEvent {
    //身份证正面
    self.uploadImgVC.imageType = 2;
    self.uploadImgVC.imageNetUrl = _identificationImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)identificationBackBtnEvent {
    //身份证反面
    self.uploadImgVC.imageType = 3;
    self.uploadImgVC.imageNetUrl = _identificationBackImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)roadTransportCertificateBtnEvent {
    //路运输许可证
    self.uploadImgVC.imageType = 6;
    self.uploadImgVC.imageNetUrl = _roadTransportCertificateImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)workLicenseBtnEvent {
    //道路运输从业资格证
    self.uploadImgVC.imageType = 1;
    self.uploadImgVC.imageNetUrl = _workLicenseImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)driverImgBtnEvent {
    //司机照
    self.uploadImgVC.imageType = 4;
    self.uploadImgVC.imageNetUrl = _driverImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)roadPermitBtnEvent {
    //道路运输经营许可证照片
    self.uploadImgVC.imageType = 13;
    self.uploadImgVC.imageNetUrl = _roadPermitNumberImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)vehicleImgBtnEvent {
    //车辆照
    self.uploadImgVC.imageType = 14;
    self.uploadImgVC.imageNetUrl = _vehicleImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)vehicleLicenseDeputyPageBtnEvent {
    self.uploadImgVC.imageType = 18;
    self.uploadImgVC.imageNetUrl = _vehicleLicenseDeputyPageImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)safeDutyInsureImgBtnEvent {
    //安全责任险照
    self.uploadImgVC.imageType = 15;
    self.uploadImgVC.imageNetUrl = _safeDutyInsureImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)depenDealImgBtnEvent {
    //挂靠协议照
    self.uploadImgVC.imageType = 16;
    self.uploadImgVC.imageNetUrl = _depenDealImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)stateImgBtnEvent {
    //车主声明照
    self.uploadImgVC.imageType = 17;
    self.uploadImgVC.imageNetUrl = _stateImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)trailerXingShiZhengBtnEvent {
    //挂车行驶证
    self.uploadImgVC.imageType = 8;
    self.uploadImgVC.imageNetUrl = _trailerVehicleLicenseImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)trailerVehicleLicenseDeputyPageImgBtnEvent {
    //挂车行驶证副页
    self.uploadImgVC.imageType = 19;
    self.uploadImgVC.imageNetUrl = _trailerVehicleLicenseDeputyPageImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)trailerZhaoBtnEvent {
    //挂车照片
    self.uploadImgVC.imageType = 12;
    self.uploadImgVC.imageNetUrl = _trailerVehicleImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}
- (void)trailerDaoLuYunShuZhengBtnEvent {
    //挂车道路运输证
    self.uploadImgVC.imageType = 9;
    self.uploadImgVC.imageNetUrl = _trailerRoadTransportCertificateImg;
    [self.navigationController pushViewController:self.uploadImgVC animated:YES];
}

- (void)vehicleTotalLessSiDianWuBtnEvent {
    
    if (_isOpenTotalWeight) {
        _totalWeightBgView.hidden = YES;
        _totalArrowImageView.transform = CGAffineTransformMakeRotation(M_PI/180);
    } else {
        _totalWeightBgView.hidden = NO;
        _totalArrowImageView.transform = CGAffineTransformMakeRotation(90 * M_PI/180);
    }
    _isOpenTotalWeight = !_isOpenTotalWeight;
}

- (void)noRequiredBtnEvent {
    
    if (_isOpenNoRequired) {
        _noRequiredBgView.hidden = YES;
        _noRequiredArrowImageView.transform = CGAffineTransformMakeRotation(M_PI/180);
    } else {
        _noRequiredBgView.hidden = NO;
        _noRequiredArrowImageView.transform = CGAffineTransformMakeRotation(90 * M_PI/180);
    }
    _isOpenNoRequired = !_isOpenNoRequired;
}

//是否挂靠
- (void)affiliatedBtnEvent {
    if (_isNotEdit) return;
    if (_isLinked) {
        _affiliatedImageView.image = image(@"gcy_img_home_business_nomal");
        _depenDealImgView.hidden = YES;
        _depenDealImgAsterisk.hidden = YES;
    } else {
        _affiliatedImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        _depenDealImgView.hidden = NO;
        _depenDealImgAsterisk.hidden = NO;
    }
    _isLinked = !_isLinked;
}
- (void)sexManEvent {
    if (_isNotEdit) return;
    _manImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
    _womenImageView.image = image(@"gcy_img_home_business_nomal");
    _sex = @"1";
}
- (void)sexWomanEvent {
    if (_isNotEdit) return;
    _manImageView.image = image(@"gcy_img_home_business_nomal");
    _womenImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
    _sex = @"2";
}
- (void)powerAttorneyAgree {
    _powerAttorneyAgreeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
    _powerAttorneyRefusedImageView.image = image(@"gcy_img_home_business_nomal");
    _isArgee = YES;
}
- (void)powerAttorneyRefused {
    _powerAttorneyAgreeImageView.image = image(@"gcy_img_home_business_nomal");
    _powerAttorneyRefusedImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
    _isArgee = NO;
}
- (void)trailerBtnEvent {
    if (_isTrailer) {
        _trailerImageView.image = image(@"gcy_img_home_business_nomal");
        _trailerBgView.hidden = YES;
        _vehicleTotalWeightTextLab.text = @"车辆总质量(kg)";
        _vehicleTotaleightTF.placeholder = @"请填写车辆总质量";
        _vehicleLoadWeightTextLab.text = @"车辆核定载质量(kg)";
        _vehicleLoadWeightTF.placeholder = @"请填写车辆核定载质量";
    } else {
        _trailerImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        _trailerBgView.hidden = NO;
        _vehicleTotalWeightTextLab.text = @"挂车车头整备质量(kg)";
        _vehicleTotaleightTF.placeholder = @"请填写挂车车头整备质量";
        _vehicleLoadWeightTextLab.text = @"准牵引总质量(kg)";
        _vehicleLoadWeightTF.placeholder = @"请填写准牵引总质量";
    }
    _isTrailer = !_isTrailer;
}

- (void)idCardDateIsLongtimeEvent {
    if (_isNotEdit) return;
    if (_idCardIsLongtime) {
        //不是长期
        _idCardDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
//        _idCardDueDateTF.text = [DCSpeedy generalGetCurrentDate:@"YYYY-MM-dd"];
        _idCardDueDateTF.text = _lastIdardDueDate;
    } else {
        //长期
        _idCardDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        _idCardDueDateTF.text = @"9999-12-31";
    }
    _idCardIsLongtime = !_idCardIsLongtime;
}

- (void)driverLicenseDueDateIsLongtimeEvent {
    if (_isNotEdit) return;
    if (_licenseIsLongtime) {
        //长期
        _driverLicenseDueDateIsLongtimeImageView.image = image(@"gcy_img_home_business_nomal");
//        _driverLicenseDueDateTF.text = [DCSpeedy generalGetCurrentDate:@"YYYY-MM-dd"];
        _driverLicenseDueDateTF.text = _lastDriverLicenseDueDate;
    } else {
        //不是长期
        _driverLicenseDueDateIsLongtimeImageView.image = [image(@"gcy_img_home_business_select") imageChangeColor:Theme_ColorValue];
        _driverLicenseDueDateTF.text = @"9999-12-31";
    }
    _licenseIsLongtime = !_licenseIsLongtime;
}

///通讯地址
- (void)provincesCityCountyChooseEvent {
    if (_isNotEdit) return;
    //通讯地址
    [[CYCityChooseView shared] show];
    [CYCityChooseView shared].pageShowFlag = 1;
    [CYCityChooseView shared].delegate = self;
}
///车辆类型
- (void)vehicleTypeChooseEvent{
    if (_isNotEdit) return;
    
    if ([DCSpeedy isBlankArr:self.vechicleTypeArray]) {
        [XSInfoView showInfo:@"车辆类型列表暂无数据" onView:self.view];
        return;
    }
    
    _vehicleTypePickerSingle = [[STPickerSingle alloc]init];
    _vehicleTypePickerSingle.widthPickerComponent = ScreenW;
    [_vehicleTypePickerSingle setArrayData:self.vechicleTypeArray];
    [_vehicleTypePickerSingle setTitle:@"请选择车辆类型"];
    [_vehicleTypePickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleTypePickerSingle setDelegate:self];
    [_vehicleTypePickerSingle setIsShowTextField:YES];//增加筛选输入框
    [_vehicleTypePickerSingle show];
}
///核定载质量
//- (void)vehicleLoadWeightChooseEvent{
//    if (_isNotEdit) return;
//    _vehicleZaiZhongPickerSingle = [[STPickerSingle alloc]init];
//    _vehicleZaiZhongPickerSingle.widthPickerComponent = ScreenW;
//    [_vehicleZaiZhongPickerSingle setArrayData:self.vechicleTonnageArray];
//    [_vehicleZaiZhongPickerSingle setTitle:@"请选择核定载质量"];
//    [_vehicleZaiZhongPickerSingle setContentMode:STPickerContentModeBottom];
//    [_vehicleZaiZhongPickerSingle setDelegate:self];
//    [_vehicleZaiZhongPickerSingle show];
//}
/////车辆总质量
//- (void)vehicleTotalWeightChooseEvent{
//    if (_isNotEdit) return;
//    _vehicleZongZhongPickerSingle = [[STPickerSingle alloc]init];
//    _vehicleZongZhongPickerSingle.widthPickerComponent = ScreenW;
//    [_vehicleZongZhongPickerSingle setArrayData:self.vechicleTonnageArray];
//    [_vehicleZongZhongPickerSingle setTitle:@"请选择车辆总质量"];
//    [_vehicleZongZhongPickerSingle setContentMode:STPickerContentModeBottom];
//    [_vehicleZongZhongPickerSingle setDelegate:self];
//    [_vehicleZongZhongPickerSingle show];
//}
///车牌颜色
- (void)licensePlateColorChooseEvent{
    if (_isNotEdit) return;
    //车牌颜色1 蓝色 2 黄色 3 黑色 4 白色 5 绿色 9 其他 91 农黄色 92 农绿色 93 黄绿色 94 渐变绿
//    NSArray *colorArr = @[@"蓝色",@"黄色",@"黑色",@"白色",@"绿色",@"农黄色",@"农绿色",@"黄绿色",@"渐变绿",@"其他"];
    _vehicleLicenseColorPickerSingle = [[STPickerSingle alloc]init];
    _vehicleLicenseColorPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleLicenseColorPickerSingle setArrayData:self.vechicleLicenseColorTitleArray];
    [_vehicleLicenseColorPickerSingle setTitle:@"请选择车牌颜色"];
    [_vehicleLicenseColorPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleLicenseColorPickerSingle setDelegate:self];
    [_vehicleLicenseColorPickerSingle show];
}

///挂车车牌颜色
- (void)trailerLicenseColorChooseEvent{
    if (_isNotEdit) return;
    _trailerLicenseColorPickerSingle = [[STPickerSingle alloc]init];
    _trailerLicenseColorPickerSingle.widthPickerComponent = ScreenW;
    [_trailerLicenseColorPickerSingle setArrayData:self.vechicleLicenseColorTitleArray];
    [_trailerLicenseColorPickerSingle setTitle:@"请选择车牌颜色"];
    [_trailerLicenseColorPickerSingle setContentMode:STPickerContentModeBottom];
    [_trailerLicenseColorPickerSingle setDelegate:self];
    [_trailerLicenseColorPickerSingle show];
}

///挂车车辆类型
- (void)trailerTypeChooseEvent{
    if (_isNotEdit) return;
    
    if ([DCSpeedy isBlankArr:self.vechicleTypeArray]) {
        [XSInfoView showInfo:@"挂车车辆类型列表暂无数据" onView:self.view];
        return;
    }
    
    _trailerTypePickerSingle = [[STPickerSingle alloc]init];
    _trailerTypePickerSingle.widthPickerComponent = ScreenW;
    [_trailerTypePickerSingle setArrayData:self.vechicleTypeArray];
    [_trailerTypePickerSingle setTitle:@"请选择挂车类型"];
    [_trailerTypePickerSingle setContentMode:STPickerContentModeBottom];
    [_trailerTypePickerSingle setDelegate:self];
    [_trailerTypePickerSingle setIsShowTextField:YES];//增加筛选输入框
    [_trailerTypePickerSingle show];
}

///车辆能源类型
- (void)vehicleEnergyTypesChooseEvent{
    if (_isNotEdit) return;
    _vehicleEnergyTypePickerSingle = [[STPickerSingle alloc] init];
    _vehicleEnergyTypePickerSingle.widthPickerComponent = ScreenW;
    [_vehicleEnergyTypePickerSingle setArrayData:self.vechicleEnergyTypeArray];
    [_vehicleEnergyTypePickerSingle setTitle:@"请选择车辆能源类型"];
    [_vehicleEnergyTypePickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleEnergyTypePickerSingle setDelegate:self];
    [_vehicleEnergyTypePickerSingle show];
}
///车辆行驶证到期日期
- (void)xingShiZhengEndDateEvent{
    if (_isNotEdit) return;
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"车辆行驶证到期日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _xingShiZhengEndDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
///准驾车型
- (void)zhunJiavehicleTypeChooseEvent {
    if (_isNotEdit) return;
    _vehicleClassPickerSingle = [[STPickerSingle alloc]init];
    _vehicleClassPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleClassPickerSingle setArrayData:self.vehicleClassArray];
    [_vehicleClassPickerSingle setTitle:@"请选择车准驾类型"];
    [_vehicleClassPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleClassPickerSingle setDelegate:self];
    [_vehicleClassPickerSingle show];
}
///驾驶证有效期自
- (void)driverLicenseFromDateEvent {
    if (_isNotEdit) return;
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"机动车驾驶证有效期自";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _driverLicenseFromDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
///驾驶证有效期至
- (void)driverLicenseDueDateEvent {
    if (_isNotEdit) return;
    //驾驶证有效期至
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"驾驶证有效期至";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _driverLicenseDueDateTF.text = selectValue;
        _lastDriverLicenseDueDate = selectValue;
    };
    [datePickerView show:self];
}
///行驶证注册日期
- (void)registerDateEvent {
    if (_isNotEdit) return;
    //注册日期
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"行驶证注册日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _registerDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
///行驶证发证日期
- (void)issueDateEvent {
    if (_isNotEdit) return;
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"车辆行驶证发证日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _issueDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
///身份证到期日期
- (void)idCardDueDateEvent{
    if (_isNotEdit) return;
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"身份证到期日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _idCardDueDateTF.text = selectValue;
        _lastIdardDueDate = selectValue;
    };
    [datePickerView show:self];
}
- (void)roadTransportCertificateDateEvent {
    if (_isNotEdit) return;
    //道路运输证到期日期
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"道路运输证到期日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _roadTransportCertificateDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
- (void)workLicenseDueDateEvent {
    if (_isNotEdit) return;
    //道路运输从业资格证到期日期
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]initWithPickerMode:BRDatePickerModeYMD];
    datePickerView.title = @"选择日期";
    datePickerView.isAutoSelect = NO;
    datePickerView.showToday = NO; // 是否显示“今天”
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        _workLicenseDueDateTF.text = selectValue;
    };
    [datePickerView show:self];
}
- (void)selfRespectEvent {
    if (_isNotEdit) return;
    _vehicleZiZhongPickerSingle = [[STPickerSingle alloc]init];
    _vehicleZiZhongPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleZiZhongPickerSingle setArrayData:self.vechicleTonnageArray];
    [_vehicleZiZhongPickerSingle setTitle:@"请选择车辆自重"];
    [_vehicleZiZhongPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleZiZhongPickerSingle setDelegate:self];
    [_vehicleZiZhongPickerSingle show];
}
- (void)carLengthEvent {
    if (_isNotEdit) return;
    _vehicleLengthPickerSingle = [[STPickerSingle alloc] init];
    _vehicleLengthPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleLengthPickerSingle setArrayData:self.vechicleLengthArray];
    [_vehicleLengthPickerSingle setTitle:@"请选择车辆长度"];
    [_vehicleLengthPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleLengthPickerSingle setDelegate:self];
    [_vehicleLengthPickerSingle show];
}
- (void)carWidthEvent {
    if (_isNotEdit) return;
    //车辆宽度
    _vehicleWidthPickerSingle = [[STPickerSingle alloc] init];
    _vehicleWidthPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleWidthPickerSingle setArrayData:self.vechicleWidthArray];
    [_vehicleWidthPickerSingle setTitle:@"请选择车辆宽度"];
    [_vehicleWidthPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleWidthPickerSingle setDelegate:self];
    [_vehicleWidthPickerSingle show];
}
- (void)carHeightEvent {
    if (_isNotEdit) return;
    //车辆高度
    _vehicleHeightPickerSingle = [[STPickerSingle alloc] init];
    _vehicleHeightPickerSingle.widthPickerComponent = ScreenW;
    [_vehicleHeightPickerSingle setArrayData:self.vechicleHeightArray];
    [_vehicleHeightPickerSingle setTitle:@"请选择车辆高度"];
    [_vehicleHeightPickerSingle setContentMode:STPickerContentModeBottom];
    [_vehicleHeightPickerSingle setDelegate:self];
    [_vehicleHeightPickerSingle show];
}

- (void)jumpDriverXieYiEvent {
    CYWebViewViewController *webVC = [[CYWebViewViewController alloc] init];
    webVC.titleString = @"司机授权委托书";
    webVC.urlString = [NSString stringWithFormat:@"%@/admin/#/PrintingMobile?partyCode=%@", BasicDomainURL, [[UserDefaultUtil valueForKey:Login_Branch] valueForKey:@"code"]];
    webVC.state = 1;
    [self.navigationController pushViewController:webVC animated:YES];
}

#pragma mark - 活体检测结果通知
- (void)faceIdentifyCompleted:(NSNotification *)notifi {
    
    NSDictionary *parmas = @{
        @"imageUrl": notifi.object,
        @"identificationImg": _identificationImg,
        @"livenessVerify": @"1",
        @"branchCode": [UserDefaultUtil valueForKey:BranchCode],
        @"token":[UserDefaultUtil valueForKey:USER_TOKEN],
    };
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], DRIVER_VERIFYIDENTITY) withParameter:parmas withVC:self netName:@"身份验证" success:^(id response, NSString *msg) {
        
        if ([response[@"pass"] integerValue] == 1) {
            
            [self driverAuthInfoRequest];
            
        } else {
            
            [XSInfoView showInfo:response[@"msg"] onView:self.view];
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

#pragma mark - 保存
- (void)btnSaveEvent {
    WEAKSELF
    GeneralPopUp *generalPopUp = [[GeneralPopUp alloc] initWithFrame:CGRectMake(0, 0, ScreenW-100, 240)];
    cut(generalPopUp, 5);
    generalPopUp.backgroundColor = [UIColor whiteColor];
    generalPopUp.mainTitle = @"提示";
    generalPopUp.subTitle = @"请确认提交认证信息？";
    generalPopUp.handleBtnTitleArray = @[@"取消", @"确定"];
    [[GlobalPopUpTool sharedInstance] popUpWithView:generalPopUp withViewController:self withAnimation:YES withCanTapBgCancel:YES];
    generalPopUp.btnActionResultBlock = ^(BOOL isConfirm, NSString * _Nonnull title, NSInteger index) {
        [[GlobalPopUpTool sharedInstance] removePopUpView];
        if (isConfirm) {
            [weakSelf checkout];
        }
    };
    
}

- (void)editBtnEvent {
    self.viewSave.hidden = NO;
    self.editView.hidden = YES;
    _isNotEdit = NO;
    
//    _nameTF.enabled = YES;
    _phoneTF.enabled = YES;
//    _idCardTF.enabled = YES;
    _chePaiNumTF.enabled = YES;
    _cheLiangDaoLuYunShuNumTF.enabled = YES;
    _daoLuYunShuJingYingNumTF.enabled = YES;
    _daoLuYunShuCongYeNumTF.enabled = YES;
    _detailAddressTF.enabled = YES;
    _workUnitTF.enabled = YES;
    _axlenumTF.enabled = YES;
    _vehicleOwnerTF.enabled = YES;
    _vehicleJiaShiZhengTF.enabled = YES;
    _vehicleXingShiZhengTF.enabled = YES;
    _vehicleActualOwnerTF.enabled = YES;
    _vehicleActualOwnerPhoneTF.enabled = YES;
    _tongXunDiZhiTF.enabled = YES;
    _vehicleTypeTF.enabled = YES;
    _vehicleLoadWeightTF.enabled = YES;
    _vehicleTotaleightTF.enabled = YES;
    _licensePlateColorTF.enabled = YES;
    _vehicleEnergyTypesTF.enabled = YES;
    _xingShiZhengEndDateTF.enabled = YES;
    _trailerNumTF.enabled = YES;
    _trailerDaoLuYunShuZhengTF.enabled = YES;
    _trailerTotalWeightTF.enabled = YES;
    _trailerLoadWeightTF.enabled = YES;
    _jiaShiZhengFaZhengJiGuanTF.enabled = YES;
    _xingShiZhengFaZhengJiGuanTF.enabled = YES;
    _cheLiangShiBieVINTF.enabled = YES;
    _shiYongXingZhiTF.enabled = YES;
    _zhunJiavehicleTypeTF.enabled = YES;
    _driverLicenseFromDateTF.enabled = NO;
    _driverLicenseDueDateTF.enabled = NO;
    _registerDateTF.enabled = YES;
    _issueDateTF.enabled = YES;
    _roadTransportCertificateDateTF.enabled = YES;
    _workLicenseDueDateTF.enabled = NO;
    _selfRespectTF.enabled = YES;
    _carLengthLabel.enabled = YES;
    _carWidthLabel.enabled = YES;
    _carHeightLabel.enabled = YES;
    _vehicleBrandTF.enabled = YES;
    _vehicleActualOwnerTF.enabled = YES;
    _vehicleActualOwnerPhoneTF.enabled = YES;
    _roadPermitNameTF.enabled = YES;
}

- (void)backBtnEvent {
    [self.navigationController popViewControllerAnimated:YES];
}

/// 数据校验
- (void)checkout {
    
    if ([[UserDefaultUtil valueForKey:isOpenJCSaasModule] integerValue] == 1) {
        if (_isArgee == NO) {
            [XSInfoView showInfo:@"请先同意司机授权委托书" onView:self.view];
            return;
        }
    }
    
    //图片校验
//    if ([_dynamicFieldDic[@"vehicleLicenseDeputyPageImg"] integerValue] == 1 && _dynamicFieldDic[@"vehicleLicenseDeputyPageImg"] != NULL) {
//        if ([DCSpeedy isBlankString:_vehicleLicenseDeputyPageImg]) {
//            [XSInfoView showInfo:@"请上传车辆行驶证副页照片" onView:self.view];
//            return;
//        }
//    }
    if ([_dynamicFieldDic[@"driverLicenseImg"] integerValue] == 1 && _dynamicFieldDic[@"driverLicenseImg"] != NULL) {
        if ([DCSpeedy isBlankString:_driverLicenseImg]) {
            [XSInfoView showInfo:@"请上传机动车驾驶证照片" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"identificationImg"] integerValue] == 1 && _dynamicFieldDic[@"identificationImg"] != NULL) {
        if ([DCSpeedy isBlankString:_identificationImg]) {
            [XSInfoView showInfo:@"请上传身司机身份证人像面照片" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"identificationBackImg"] integerValue] == 1 && _dynamicFieldDic[@"identificationBackImg"] != NULL) {
        if ([DCSpeedy isBlankString:_identificationBackImg]) {
            [XSInfoView showInfo:@"请上传司机身份证国徽面照片" onView:self.view];
            return;
        }
    }
    
    if ([_dynamicFieldDic[@"workLicenseImg"] integerValue] == 1 && _dynamicFieldDic[@"workLicenseImg"] != NULL) {
        if ([DCSpeedy isBlankString:_workLicenseImg]) {
            [XSInfoView showInfo:@"请上传道路运输从业资格证照片" onView:self.view];
            return;
        }
    }
//    if([_dynamicFieldDic[@"roadPerExpiryDateImg"] integerValue] == 1 && _dynamicFieldDic[@"roadPerExpiryDateImg"] != NULL) {
//        if ([DCSpeedy isBlankString:_roadPerExpiryDateImg]) {
//            [XSInfoView showInfo:@"请上传道路运输证到期日期照片" onView:self.view];
//            return;
//        }
//    }
    if ([_dynamicFieldDic[@"driverImg"] integerValue] == 1 && _dynamicFieldDic[@"driverImg"] != NULL) {
        if ([DCSpeedy isBlankString:_driverImg]) {
            [XSInfoView showInfo:@"请上传司机半身照" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"safeDutyInsureImg"] integerValue] == 1 && _dynamicFieldDic[@"safeDutyInsureImg"] != NULL) {
        if ([DCSpeedy isBlankString:_safeDutyInsureImg]) {
            [XSInfoView showInfo:@"请上传安全责任险照片" onView:self.view];
            return;
        }
    }
//    if ([_dynamicFieldDic[@"depenDealImg"] integerValue] == 1 && _dynamicFieldDic[@"depenDealImg"] != NULL && _isTax == 1) {
//        if ([DCSpeedy isBlankString:_depenDealImg]) {
//            [XSInfoView showInfo:@"请上传挂靠协议照片" onView:self.view];
//            return;
//        }
//    }
    
    ///表单校验
    if ([_dynamicFieldDic[@"name"] integerValue] == 1 && _dynamicFieldDic[@"name"] != NULL) {
        if ([DCSpeedy isBlankString:_nameTF.text]) {
            [XSInfoView showInfo:@"请输入驾驶员姓名" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"phone"] integerValue] == 1 && _dynamicFieldDic[@"phone"] != NULL) {
        if ([DCSpeedy isBlankString:_phoneTF.text]) {
            [XSInfoView showInfo:@"请输入联系方式" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"identificationNumber"] integerValue] == 1 && _dynamicFieldDic[@"identificationNumber"] != NULL) {
        if ([DCSpeedy isBlankString:_idCardTF.text]) {
            [XSInfoView showInfo:@"请输入身份证号" onView:self.view];
            return;
        }
        if ([CYCheckRegular cy_checkUserIcyard:_idCardTF.text] == NO) {
            [XSInfoView showInfo:@"请输入正确的身份证号" onView:self.view];
            return;
        }
    }
    
    if ([_dynamicFieldDic[@"workLicense"] integerValue] == 1 && _dynamicFieldDic[@"workLicense"] != NULL) {
        if ([DCSpeedy isBlankString:_daoLuYunShuCongYeNumTF.text]) {
            [XSInfoView showInfo:@"请输入道路运输从业资格证号" onView:self.view];
            return;
        }
//        if (_daoLuYunShuCongYeNumTF.text.length != 18) {
//            [XSInfoView showInfo:@"道路运输从业资格证号必须为18位" onView:self.view];
//            return;
//        }
    }
    if ([_dynamicFieldDic[@"homeAddress"] integerValue] == 1 && _dynamicFieldDic[@"homeAddress"] != NULL) {
        if ([DCSpeedy isBlankString:_detailAddressTF.text]) {
            [XSInfoView showInfo:@"请输入详细地址" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"workCompany"] integerValue] == 1 && _dynamicFieldDic[@"workCompany"] != NULL) {
        if ([DCSpeedy isBlankString:_workUnitTF.text]) {
            [XSInfoView showInfo:@"请输入工作单位" onView:self.view];
            return;
        }
    }
    
    if ([_dynamicFieldDic[@"driverLicense"] integerValue] == 1 && _dynamicFieldDic[@"driverLicense"] != NULL) {
        if ([DCSpeedy isBlankString:_vehicleJiaShiZhengTF.text]) {
            [XSInfoView showInfo:@"请输入机动车驾驶证号" onView:self.view];
            return;
        }
//        if (_vehicleJiaShiZhengTF.text.length == 15 || _vehicleJiaShiZhengTF.text.length == 18) {
//
//        } else {
//            [XSInfoView showInfo:@"机动车驾驶证号必须为15位或18位" onView:self.view];
//            return;
//        }
    }
    //如果是江苏省
    if (_reportPlatform == 3) {
        
        if ([_dynamicFieldDic[@"sex"] integerValue] == 1 && _dynamicFieldDic[@"sex"] != NULL) {
            if ([DCSpeedy isBlankString:_sex]) {
                [XSInfoView showInfo:@"请选择性别" onView:self.view];
                return;
            }
        }
    }
    
    if ([_dynamicFieldDic[@"areaList"] integerValue] == 1 && _dynamicFieldDic[@"areaList"] != NULL) {
        //通讯地址
        if ([DCSpeedy isBlankString:_provinceCode]) {
            [XSInfoView showInfo:@"请选择通信地址" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"idCardDueDate"] integerValue] == 1 && _dynamicFieldDic[@"idCardDueDate"] != NULL) {
        if ([DCSpeedy isBlankString:_idCardDueDateTF.text]) {
            [XSInfoView showInfo:@"请选择身份证到期日期" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"driverLicenseDueDate"] integerValue] == 1 && _dynamicFieldDic[@"driverLicenseDueDate"] != NULL) {
        if ([DCSpeedy isBlankString:_driverLicenseDueDateTF.text]) {
            [XSInfoView showInfo:@"请选择驾驶证到期日期" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"workLicenseDueDate"] integerValue] == 1 && _dynamicFieldDic[@"workLicenseDueDate"] != NULL) {
        if ([DCSpeedy isBlankString:_workLicenseDueDateTF.text]) {
            [XSInfoView showInfo:@"请选择道路运输从业资格证到期日期" onView:self.view];
            return;
        }
    }
    /*
     4.5吨必填控制：小于等于4.5吨必填，后台不可设置为非必填，大于4.5吨，默认非必填，后台必填项设置可设置
     */
    if ([_dynamicFieldDic[@"driverIssuingOrganizations"] integerValue] == 1 && _dynamicFieldDic[@"driverIssuingOrganizations"] != NULL) {
        if ([DCSpeedy isBlankString:_jiaShiZhengFaZhengJiGuanTF.text]) {
            [XSInfoView showInfo:@"请输入驾驶证发证机关" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"vehicleClass"] integerValue] == 1 && _dynamicFieldDic[@"vehicleClass"] != NULL) {
        if ([DCSpeedy isBlankString:_zhunJiavehicleTypeTF.text]) {
            [XSInfoView showInfo:@"请选择准驾类型" onView:self.view];
            return;
        }
    }
    if ([_dynamicFieldDic[@"driverLicenseFromDate"] integerValue] == 1 && _dynamicFieldDic[@"driverLicenseFromDate"] != NULL) {
        if ([DCSpeedy isBlankString:_driverLicenseFromDateTF.text]) {
            [XSInfoView showInfo:@"请选择驾驶证开始日期" onView:self.view];
            return;
        }
    }
//    if ([_dynamicFieldDic[@"selfRespect"] integerValue] == 1 && _dynamicFieldDic[@"selfRespect"] != NULL) {
//        if ([DCSpeedy isBlankString:_selfRespectTF.text]) {
//            [XSInfoView showInfo:@"请输入车身自重" onView:self.view];
//            return;
//        }
//    }
    
    [self driverAuthInfoRequest];
    
//    if ([[UserDefaultUtil valueForKey:Login_Branch][@"taxPlatform"] integerValue] == 2 && [[UserDefaultUtil valueForKey:Login_Branch][@"isLiveness"] integerValue] == 0) {
//
//        //使用拍照方式人证核验
//        [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], DRIVER_VERIFYIDENTITYONOFF) withParameter:@{@"branchCode": [UserDefaultUtil valueForKey:BranchCode], @"token":[UserDefaultUtil valueForKey:USER_TOKEN],} withVC:self netName:@"是否开启身份验证" success:^(id response, NSString *msg) {
//            if ([response[@"toVerifyIdentity"] integerValue] == 1) {
//
//                TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 columnNumber:4 delegate:nil pushPhotoPickerVc:YES];
//                [imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
//
//                    [HTTPManager postUploadFiles:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-tps-api",[ReAddressDynamic shared].baseUrl], FILE_UPLOAD) file:@[[photos firstObject]] fileName:@"file" withVC:self netName:@"文件上传" success:^(id response, NSString *msg) {
//
//                        NSDictionary *parmas = @{
//                            @"peopleImg": response[@"data"],
//                            @"branchCode": [UserDefaultUtil valueForKey:BranchCode],
//                            @"token":[UserDefaultUtil valueForKey:USER_TOKEN],
//                        };
//                        [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@/ntocc-basic-api/driver/faceVerify", BasicDomainURL) withParameter:parmas withVC:self netName:@"身份验证" success:^(id response, NSString *msg) {
//
//                            if ([response[@"pass"] integerValue] == 1) {
//
//                                [self driverAuthInfoRequest];
//
//                            } else {
//
//                                [XSInfoView showInfo:response[@"msg"] onView:self.view];
//                            }
//
//                        } failure:^(NSInteger code, NSString *msg) {
//
//                        }];
//
//                    } failure:^(NSInteger code, NSString *msg) {
//
//                    }];
//
//                }];
//                imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
//                [self presentViewController:imagePickerVc animated:YES completion:nil];
//
//            } else {
//
//                [self driverAuthInfoRequest];
//            }
//
//        } failure:^(NSInteger code, NSString *msg) {
//
//        }];
//
//
//    } else {
//
//        [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], DRIVER_VERIFYIDENTITYONOFF) withParameter:@{@"branchCode": [UserDefaultUtil valueForKey:BranchCode], @"token":[UserDefaultUtil valueForKey:USER_TOKEN],} withVC:self netName:@"是否开启身份验证" success:^(id response, NSString *msg) {
//            if ([response[@"toVerifyIdentity"] integerValue] == 1) {
//
//                if (![[FaceSDKManager sharedInstance] canWork]) {
//                    NSString* licensePath = [[NSBundle mainBundle] pathForResource:FACE_LICENSE_NAME ofType:FACE_LICENSE_SUFFIX];
//                    [[FaceSDKManager sharedInstance] setLicenseID:FACE_LICENSE_ID andLocalLicenceFile:licensePath andRemoteAuthorize:YES];
//                }
//                [self faceLiveness];
//
//            } else {
//
//                [self driverAuthInfoRequest];
//            }
//
//        } failure:^(NSInteger code, NSString *msg) {
//
//        }];
//    }
}

#ifdef isOpenBaiDuFaceSDK
//人脸认证
- (void)faceLiveness {
    BDFaceLivenessViewController* lvc = [[BDFaceLivenessViewController alloc] init];
    BDFaceLivingConfigModel* model = [BDFaceLivingConfigModel sharedInstance];
    [lvc livenesswithList:model.liveActionArray order:model.isByOrder numberOfLiveness:model.numOfLiveness];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:lvc];
    navi.navigationBarHidden = true;
    navi.modalPresentationStyle = UIModalPresentationFullScreen;
    [self presentViewController:navi animated:YES completion:nil];
}
#endif

#pragma mark - 司机认证信息提交
- (void)driverAuthInfoRequest {
    WEAKSELF
    NSDictionary *parmas = @{
        @"name": _nameTF.text,//驾驶员姓名
        @"phone": _phoneTF.text,//联系方式
        @"identificationNumber": _idCardTF.text,//身份证
        @"idCardDueDate": _idCardDueDateTF.text,//身份证有效期
        @"workLicense": _daoLuYunShuCongYeNumTF.text,//道路运输从业资格证号
        @"homeAddress": _detailAddressTF.text,//详细地址
        @"workCompany": _workUnitTF.text,//工作单位
        @"driverLicense": _vehicleJiaShiZhengTF.text,//机动车驾驶证号
        @"workLicenseDueDate": _workLicenseDueDateTF.text,//道路运输从业资格证到期日期
        @"driverLicenseImg": _driverLicenseImg,//驾驶证照
        @"identificationImg": _identificationImg,//身份证正面照
        @"identificationBackImg": _identificationBackImg,//身份证反面照
        @"workLicenseImg": _workLicenseImg,//道路运输从业资格证照片
        @"driverImg": _driverImg,//司机照
        @"provinceCode": _provinceCode,
        @"cityCode": _cityCode,
        @"countyCode": _countyCode,
        @"sex": _sex,//性别(江苏项目需要)
        
        @"issuingOrganizations": _jiaShiZhengFaZhengJiGuanTF.text,//驾驶证发证机关
        @"vehicleClass": _vehicleClass,//准驾车型
        @"driverLicenseFromDate": _driverLicenseFromDateTF.text,//驾驶证有效期开始
        @"driverLicenseDueDate": _driverLicenseDueDateTF.text,//驾驶证到期日期
        @"safeDutyInsureImg": _safeDutyInsureImg,//安全责任险照片

        @"partyCode":[UserDefaultUtil valueForKey:DriverPartyCode],
        @"token":[UserDefaultUtil valueForKey:USER_TOKEN],
        @"roadPerExpiryDateImg":_roadPerExpiryDateImg,
    };
    
    [HTTPManager putNetworkRequest:CJStringWithFormat(@"%@%@", [NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl], DRIVER_UPDATEINFO) withParameter:parmas withVC:self netName:@"司机信息认证" success:^(id response, NSString *msg) {
        
        [XSInfoView showInfo:msg onView:weakSelf.view];
        
        [KNotificationCenter postNotificationName:LOGIN_SUCCESS object:nil];
        [KNotificationCenter postNotificationName:DUE_ALERT object:nil];
        
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1.0 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void){
            [weakSelf.navigationController popViewControllerAnimated:YES];
        });
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

#pragma mark - CYChooseRegionDelegate
- (void)getAllInfoProvinceCode:(NSString *)provinceCode provinceName:(NSString *)provinceName cityCode:(NSString *)cityCode cityName:(NSString *)cityName countyCode:(NSString *)countyCode countyName:(NSString *)countyName {
    
    if ([DCSpeedy isBlankString:countyCode] == YES) {
        [XSInfoView showInfo:@"通讯地址请精确到区/县" onView:self.view];
       
        [[CYCityChooseView shared] show];
        [CYCityChooseView shared].pageShowFlag = 1;
        [CYCityChooseView shared].delegate = self;
        
        return;
    }
    
    NSString *address = CJStringWithFormat(@"%@%@%@",provinceName,cityName,countyName);
    
    _tongXunDiZhiTF.text = address;
    
    _provinceCode = provinceCode;
    _cityCode = cityCode;
    _countyCode = countyCode;
}

#pragma mark -- STPickerSingleDelegate
- (void)pickerSingle:(STPickerSingle *)pickerSingle selectedTitle:(NSString *)selectedTitle {
    
    if (pickerSingle == _vehicleTypePickerSingle) {
        //车辆类型
        _vehicleTypeTF.text = selectedTitle;
        NSInteger index = [self.vechicleTypeArray indexOfObject:selectedTitle];
        _classificationCode = self.vechicleTypeModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleZaiZhongPickerSingle) {
        //核定载质量
        _vehicleLoadWeightTF.text = selectedTitle;
        NSInteger index = [self.vechicleTonnageArray indexOfObject:selectedTitle];
        _loadWeight = self.vechicleTonnageModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleZongZhongPickerSingle) {
        //车辆总质量
        _vehicleTotaleightTF.text = selectedTitle;
        NSInteger index = [self.vechicleTonnageArray indexOfObject:selectedTitle];
        _totalWeight = self.vechicleTonnageModelArray[index][@"code"];
        
        _totalWeightNum = [selectedTitle floatValue];
        
        if (_totalWeightNum <= 4500) {
            _jiaShiZhengFaZhengJiGuanTFView.hidden = NO;//驾驶证发证机关
            _cheLiangShiBieVINTFView.hidden = NO;//车辆识别代码
            _xingShiZhengFaZhengJiGuanTFView.hidden = NO;//行驶证发证机关
            _shiYongXingZhiTFView.hidden = NO;//使用性质
            _zhunJiavehicleTypeTFView.hidden = NO;//准驾车型
            _driverLicenseFromDateTFView.hidden = NO;//驾驶证有效期开始
            _driverLicenseDueDateTFView.hidden = NO;//驾驶证到期日期
            _registerDateTFView.hidden = NO;//注册日期
            _issueDateTFView.hidden = NO;//发证日期
        } else {
            [self fieldCalibrationRequest];
        }
        
    } else if (pickerSingle == _vehicleLicenseColorPickerSingle) {
        //车牌颜色
        _licensePlateColorTF.text = selectedTitle;
        NSInteger index = [self.vechicleLicenseColorTitleArray indexOfObject:selectedTitle];
        _vehicleLicenseColor = self.vechicleLicenseColorModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleEnergyTypePickerSingle) {
        //车辆能源类型
        _vehicleEnergyTypesTF.text = selectedTitle;
        NSInteger index = [self.vechicleEnergyTypeArray indexOfObject:selectedTitle];
        _vehicleEnergyType = self.vechicleEnergyModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleZiZhongPickerSingle) {
        //车身自重按钮
        _selfRespectTF.text = selectedTitle;
        NSInteger index = [self.vechicleTonnageArray indexOfObject:selectedTitle];
        _selfRespect = self.vechicleTonnageModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleLengthPickerSingle) {
        //车辆长度
        _carLengthLabel.text = selectedTitle;
        NSInteger index = [self.vechicleLengthArray indexOfObject:selectedTitle];
        _vehicleLength = self.vechicleLengthModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleWidthPickerSingle) {
        //车辆宽度
        _carWidthLabel.text = selectedTitle;
        NSInteger index = [self.vechicleWidthArray indexOfObject:selectedTitle];
        _vehicleWidth = self.vechicleWidthModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleHeightPickerSingle) {
        //车辆高度
        _carHeightLabel.text = selectedTitle;
        NSInteger index = [self.vechicleHeightArray indexOfObject:selectedTitle];
        _vehicleHeight = self.vechicleHeightModelArray[index][@"code"];
        
    } else if (pickerSingle == _vehicleClassPickerSingle) {
        //准驾车型按钮
        _zhunJiavehicleTypeTF.text = selectedTitle;
        NSInteger index = [self.vehicleClassArray indexOfObject:selectedTitle];
        _vehicleClass = self.vechicleClassModelArray[index][@"code"];
        
    } else if (pickerSingle == _trailerLicenseColorPickerSingle) {
        //挂车车牌颜色
        _trailerLicenseColorTF.text = selectedTitle;
        NSInteger index = [self.vechicleLicenseColorTitleArray indexOfObject:selectedTitle];
        _trailerLicenseColor = self.vechicleLicenseColorModelArray[index][@"code"];
        
    } else if (pickerSingle == _trailerTypePickerSingle) {
        //挂车车辆类型
        _trailerTypeTF.text = selectedTitle;
        NSInteger index = [self.vechicleTypeArray indexOfObject:selectedTitle];
        _trailerClassificationCode = self.vechicleTypeModelArray[index][@"code"];
        
    }
}


#pragma mark - 数据字典请求
- (void)vehicleLicenseColorListRequest {
    WEAKSELF
    
    NSDictionary *parmas = @{@"types": @"vehicleLicenseColor", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:parmas withVC:self netName:@"车型列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleLicenseColorModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleLicenseColorTitleArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (void)vechicleTypeListRequest {
    WEAKSELF
    
    NSDictionary *parmas = @{@"types": @"vehicleClassification", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:parmas withVC:self netName:@"车型列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleTypeModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleTypeArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (void)vechicleTonnageListRequest {
    WEAKSELF
    
    NSDictionary *parmas = @{@"types": @"vehicleTonnage", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:parmas withVC:self netName:@"车型吨位列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleTonnageModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleTonnageArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (void)vechicleEnergyTypeListRequest {
    WEAKSELF
    
    NSDictionary *parmas = @{@"types": @"vehicleEnergyType", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:parmas withVC:self netName:@"车辆能源类型列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleEnergyModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleEnergyTypeArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (void)vehicleClassListRequest {
    WEAKSELF
    
    NSDictionary *parmas = @{@"types": @"vehicleTypeAllow", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:parmas withVC:self netName:@"准驾类型列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleClassModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vehicleClassArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (void)vehicleLengthWidthHeightListRequest {
    WEAKSELF
    
    NSDictionary *vehicleLength = @{@"types": @"vehicleLength", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:vehicleLength withVC:self netName:@"车辆长度列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleLengthModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleLengthArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
    
    NSDictionary *vehicleWidth = @{@"types": @"vehicleWidth", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:vehicleWidth withVC:self netName:@"车辆宽度列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleWidthModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleWidthArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
    
    NSDictionary *vehicleHigh = @{@"types": @"vehicleHigh", @"token":[UserDefaultUtil valueForKey:USER_TOKEN],};
    [HTTPManager getNetworkRequest:CJStringWithFormat(@"%@%@",[NSString stringWithFormat:@"%@/ntocc-basic-api",[ReAddressDynamic shared].baseUrl],DICT_LISTDICT) withParameter:vehicleHigh withVC:self netName:@"车辆高度列表" success:^(id response, NSString *msg) {
        
        if ([[response firstObject][@"dictList"] count] != 0) {
            self.vechicleHeightModelArray = [response firstObject][@"dictList"];
            [[response firstObject][@"dictList"] enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                [weakSelf.vechicleHeightArray addObject:obj[@"name"]];
            }];
            
        }
        
    } failure:^(NSInteger code, NSString *msg) {
        
    }];
}

- (NSMutableArray *)vechicleTypeArray {
    if (!_vechicleTypeArray) {
        _vechicleTypeArray = [[NSMutableArray alloc] init];
    }
    return _vechicleTypeArray;
}

- (NSMutableArray *)vechicleTonnageArray {
    if (!_vechicleTonnageArray) {
        _vechicleTonnageArray = [[NSMutableArray alloc] init];
    }
    return _vechicleTonnageArray;
}
- (NSMutableArray *)vechicleEnergyTypeArray {
    if (!_vechicleEnergyTypeArray) {
        _vechicleEnergyTypeArray = [[NSMutableArray alloc] init];
    }
    return _vechicleEnergyTypeArray;
}

- (NSMutableArray *)vehicleClassArray {
    if (!_vehicleClassArray) {
        _vehicleClassArray = [[NSMutableArray alloc] init];
    }
    return _vehicleClassArray;
}
- (NSMutableArray *)vechicleTypeModelArray {
    if (!_vechicleTypeModelArray) {
        _vechicleTypeModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleTypeModelArray;
}
- (NSMutableArray *)vechicleTonnageModelArray {
    if (!_vechicleTonnageModelArray) {
        _vechicleTonnageModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleTonnageModelArray;
}
- (NSMutableArray *)vechicleEnergyModelArray {
    if (!_vechicleEnergyModelArray) {
        _vechicleEnergyModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleEnergyModelArray;
}

- (NSMutableArray *)vechicleClassModelArray {
    if (!_vechicleClassModelArray) {
        _vechicleClassModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleClassModelArray;
}
- (NSMutableArray *)vechicleLicenseColorTitleArray {
    if (!_vechicleLicenseColorTitleArray) {
        _vechicleLicenseColorTitleArray = [[NSMutableArray alloc] init];
    }
    return _vechicleLicenseColorTitleArray;
}
- (NSMutableArray *)vechicleLicenseColorModelArray {
    if (!_vechicleLicenseColorModelArray) {
        _vechicleLicenseColorModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleLicenseColorModelArray;
}
- (NSMutableArray *)vechicleLengthArray {
    if (!_vechicleLengthArray) {
        _vechicleLengthArray = [[NSMutableArray alloc] init];
    }
    return _vechicleLengthArray;
}
- (NSMutableArray *)vechicleLengthModelArray {
    if (!_vechicleLengthModelArray) {
        _vechicleLengthModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleLengthModelArray;
}
- (NSMutableArray *)vechicleWidthArray {
    if (!_vechicleWidthArray) {
        _vechicleWidthArray = [[NSMutableArray alloc] init];
    }
    return _vechicleWidthArray;
}
- (NSMutableArray *)vechicleWidthModelArray {
    if (!_vechicleWidthModelArray) {
        _vechicleWidthModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleWidthModelArray;
}
- (NSMutableArray *)vechicleHeightArray {
    if (!_vechicleHeightArray) {
        _vechicleHeightArray = [[NSMutableArray alloc] init];
    }
    return _vechicleHeightArray;
}
- (NSMutableArray *)vechicleHeightModelArray {
    if (!_vechicleHeightModelArray) {
        _vechicleHeightModelArray = [[NSMutableArray alloc] init];
    }
    return _vechicleHeightModelArray;
}
- (ImageUploadViewController *)uploadImgVC {
    if (!_uploadImgVC) {
        _uploadImgVC = [[ImageUploadViewController alloc] init];
        _uploadImgVC.isAddWatermark = YES;
        _uploadImgVC.delegate = self;
    }
    if (_isNotEdit) {
        _uploadImgVC.isHiddenBtn = YES;
    } else {
        _uploadImgVC.isHiddenBtn = NO;
    }
    return _uploadImgVC;
}

#pragma mark - 表单验证规范
- (void)formValidationSetup {
    
    /*姓名*/
    _nameTF.textFieldType = CJTextFieldStringTypeNone;
    _nameTF.maxLength = 20;
    
    _phoneTF.textFieldType = CJTextFieldStringTypeNumber;
    _phoneTF.keyboardType = UIKeyboardTypeNumberPad;
    _phoneTF.maxLength = 11;
    
    /*身份证号*/
    _idCardTF.textFieldType = CJTextFieldStringTypeNone;
    _idCardTF.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
    _idCardTF.maxLength = 18;
    
    /*车牌号*/
    _chePaiNumTF.textFieldType = CJTextFieldStringTypeNone;
    _chePaiNumTF.maxLength = 9;
    
    /*车辆道路运输证*/
    _cheLiangDaoLuYunShuNumTF.textFieldType = CJTextFieldStringTypePassword;
//    _cheLiangDaoLuYunShuNumTF.keyboardType = UIKeyboardTypeNumberPad;
    _cheLiangDaoLuYunShuNumTF.maxLength = 128;
    
    /*道路运输经营许可证*/
    _daoLuYunShuJingYingNumTF.textFieldType = CJTextFieldStringTypePassword;
//    _daoLuYunShuJingYingNumTF.keyboardType = UIKeyboardTypeNumberPad;
    _daoLuYunShuJingYingNumTF.maxLength = 128;
    
    /*道路运输经营许可证业户名称*/
    _roadPermitNameTF.textFieldType = CJTextFieldStringTypeNone;
    _roadPermitNameTF.maxLength = 255;
    
    /*道路运输从业资格证 18位或者19位*/
    _daoLuYunShuCongYeNumTF.textFieldType = CJTextFieldStringTypePassword;
//    _daoLuYunShuCongYeNumTF.keyboardType = UIKeyboardTypeNumberPad;
    _daoLuYunShuCongYeNumTF.maxLength = 128;
    
    /*详细地址*/
    _detailAddressTF.textFieldType = CJTextFieldStringTypeNone;
    _detailAddressTF.maxLength = 128;
    
    /*工作单位*/
    _workUnitTF.textFieldType = CJTextFieldStringTypeNone;
    _workUnitTF.maxLength = 128;
    
    /*车辆所有人*/
    _vehicleOwnerTF.textFieldType = CJTextFieldStringTypeNone;
    _vehicleOwnerTF.maxLength = 10;
    
    /*机动车驾驶证号*/
    _vehicleJiaShiZhengTF.textFieldType = CJTextFieldStringTypePassword;
    _vehicleJiaShiZhengTF.maxLength = 128;
    
    /*行驶证档案编号*/
    _vehicleXingShiZhengTF.textFieldType = CJTextFieldStringTypePassword;
    _vehicleXingShiZhengTF.maxLength = 128;
    
    /*车轴数*/
    _axlenumTF.textFieldType = CJTextFieldStringTypeNumber;
    _axlenumTF.keyboardType = UIKeyboardTypeNumberPad;
    _axlenumTF.maxLength = 2;
    
    /*车辆实际所有人*/
    _vehicleActualOwnerTF.textFieldType = CJTextFieldStringTypeNone;
    _vehicleActualOwnerTF.maxLength = 10;
    
    /*车辆实际所有人联系方式*/
    _vehicleActualOwnerPhoneTF.textFieldType = CJTextFieldStringTypeNumber;
    _vehicleActualOwnerPhoneTF.keyboardType = UIKeyboardTypeNumberPad;
    _vehicleActualOwnerPhoneTF.maxLength = 11;
    
    /*驾驶证发证机关*/
    _jiaShiZhengFaZhengJiGuanTF.textFieldType = CJTextFieldStringTypeNone;
    _jiaShiZhengFaZhengJiGuanTF.maxLength = 20;
    
    /*车辆VIN识别码*/
    _cheLiangShiBieVINTF.textFieldType = CJTextFieldStringTypePassword;
    _cheLiangShiBieVINTF.maxLength = 128;
    
    /*行驶证发证机关*/
    _xingShiZhengFaZhengJiGuanTF.textFieldType = CJTextFieldStringTypeNone;
    _xingShiZhengFaZhengJiGuanTF.maxLength = 20;
    
    /*使用性质*/
    _shiYongXingZhiTF.textFieldType = CJTextFieldStringTypeNone;
    _shiYongXingZhiTF.maxLength = 10;
    
    /*挂车车牌*/
    _trailerNumTF.textFieldType = CJTextFieldStringTypeNone;
    _trailerNumTF.maxLength = 9;
    
    /*挂车道路运输证*/
    _trailerDaoLuYunShuZhengTF.textFieldType = CJTextFieldStringTypeNumber;
    _trailerDaoLuYunShuZhengTF.keyboardType = UIKeyboardTypeNumberPad;
    _trailerDaoLuYunShuZhengTF.maxLength = 128;
    
    /*挂车总重*/
    _trailerTotalWeightTF.textFieldType = CJTextFieldStringTypeNumber;
    _trailerTotalWeightTF.keyboardType = UIKeyboardTypeNumberPad;
    _trailerTotalWeightTF.maxLength = 7;
    
    /*挂车载重*/
    _trailerLoadWeightTF.textFieldType = CJTextFieldStringTypeNumber;
    _trailerLoadWeightTF.keyboardType = UIKeyboardTypeNumberPad;
    _trailerLoadWeightTF.maxLength = 7;
    
    /*挂车核定载质量*/
    _trailerLoadWeightTF.textFieldType = CJTextFieldStringTypeNumber;
    _trailerLoadWeightTF.keyboardType = UIKeyboardTypeNumberPad;
    _trailerLoadWeightTF.maxLength = 7;
    
    /*车长*/
    _carLengthLabel.textFieldType = CJTextFieldStringTypeNumber;
    _carLengthLabel.keyboardType = UIKeyboardTypeNumberPad;
    _carLengthLabel.maxLength = 6;
    
    /*车宽*/
    _carWidthLabel.textFieldType = CJTextFieldStringTypeNumber;
    _carWidthLabel.keyboardType = UIKeyboardTypeNumberPad;
    _carWidthLabel.maxLength = 6;
    
    /*车高*/
    _carHeightLabel.textFieldType = CJTextFieldStringTypeNumber;
    _carHeightLabel.keyboardType = UIKeyboardTypeNumberPad;
    _carHeightLabel.maxLength = 6;
    
    /*车辆总质量*/
    _vehicleTotaleightTF.textFieldType = CJTextFieldStringTypeNumber;
    _vehicleTotaleightTF.keyboardType = UIKeyboardTypeNumberPad;
    _vehicleTotaleightTF.maxLength = 6;
    
    /*车辆核定载质量*/
    _vehicleLoadWeightTF.textFieldType = CJTextFieldStringTypeNumber;
    _vehicleLoadWeightTF.keyboardType = UIKeyboardTypeNumberPad;
    _vehicleLoadWeightTF.maxLength = 6;
    
    /*车辆自重*/
    _selfRespectTF.textFieldType = CJTextFieldStringTypeNumber;
    _selfRespectTF.keyboardType = UIKeyboardTypeNumberPad;
    _selfRespectTF.maxLength = 6;
}

#pragma mark - 车队司机表单全部不能编辑
- (void)notEditSetUp {
    _viewSave.hidden = YES;
    _editView.hidden = YES;
    _isNotEdit = YES;
    
    _nameTF.enabled = NO;
    _phoneTF.enabled = NO;
    _idCardTF.enabled = NO;
    _chePaiNumTF.enabled = NO;
    _cheLiangDaoLuYunShuNumTF.enabled = NO;
    _daoLuYunShuJingYingNumTF.enabled = NO;
    _daoLuYunShuCongYeNumTF.enabled = NO;
    _detailAddressTF.enabled = NO;
    _workUnitTF.enabled = NO;
    _axlenumTF.enabled = NO;
    _vehicleOwnerTF.enabled = NO;
    _vehicleJiaShiZhengTF.enabled = NO;
    _vehicleXingShiZhengTF.enabled = NO;
    _vehicleActualOwnerTF.enabled = NO;
    _vehicleActualOwnerPhoneTF.enabled = NO;
    _tongXunDiZhiTF.enabled = NO;
    _vehicleTypeTF.enabled = NO;
    _vehicleLoadWeightTF.enabled = NO;
    _vehicleTotaleightTF.enabled = NO;
    _licensePlateColorTF.enabled = NO;
    _vehicleEnergyTypesTF.enabled = NO;
    _xingShiZhengEndDateTF.enabled = NO;
    _trailerNumTF.enabled = NO;
    _trailerDaoLuYunShuZhengTF.enabled = NO;
    _trailerTotalWeightTF.enabled = NO;
    _trailerLoadWeightTF.enabled = NO;
    _jiaShiZhengFaZhengJiGuanTF.enabled = NO;
    _xingShiZhengFaZhengJiGuanTF.enabled = NO;
    _cheLiangShiBieVINTF.enabled = NO;
    _shiYongXingZhiTF.enabled = NO;
    _zhunJiavehicleTypeTF.enabled = NO;
    _driverLicenseFromDateTF.enabled = NO;
    _driverLicenseDueDateTF.enabled = NO;
    _registerDateTF.enabled = NO;
    _issueDateTF.enabled = NO;
    _roadTransportCertificateDateTF.enabled = NO;
    _workLicenseDueDateTF.enabled = NO;
    _selfRespectTF.enabled = NO;
    _carLengthLabel.enabled = NO;
    _carWidthLabel.enabled = NO;
    _carHeightLabel.enabled = NO;
    _vehicleBrandTF.enabled = NO;
    _vehicleActualOwnerTF.enabled = NO;
    _vehicleActualOwnerPhoneTF.enabled = NO;
    _roadPermitNameTF.enabled = NO;
    
//    _roadPermitImgBgView.hidden = YES;
//    _roadPermitNumBgView.hidden = YES;
}
#define mark - UITextFieldDelegate
- (void)textFieldDidEndEditing:(UITextField *)textField{
    
    //获取当前文本输入框中所输入的文字
//    if (textField == _vehicleTotaleightTF) {
//        NSLog(@"所输入的内容为:%@",textField.text);
        
//        _totalWeightNum = [textField.text floatValue];
        
//        if (_totalWeightNum <= 4500) {
//            _jiaShiZhengFaZhengJiGuanTFView.hidden = NO;//驾驶证发证机关
//            _cheLiangShiBieVINTFView.hidden = NO;//车辆识别代码
//            _xingShiZhengFaZhengJiGuanTFView.hidden = NO;//行驶证发证机关
//            _jiaShiZhengFaZhengJiGuanTFView.hidden = NO;//驾驶证发证机关
//            _shiYongXingZhiTFView.hidden = NO;//使用性质
//            _zhunJiavehicleTypeTFView.hidden = NO;//准驾车型
//            _driverLicenseFromDateTFView.hidden = NO;//驾驶证有效期开始
////            _driverLicenseDueDateTFView.hidden = NO;//驾驶证到期日期
//            _registerDateTFView.hidden = NO;//注册日期
//            _issueDateTFView.hidden = NO;//发证日期
//        }
//    }
    
}
@end
